<table id="example" class="table table-striped table-bordered" style="width:100%">
<thead>
<tr>
<th colspan="2" class="tble_fb">Calender</th>
<th colspan="1" class="tble_fb">Order #</th>
<th colspan="1" class="tble_fb">Order Status</th>
<th colspan="5" class="tble_fb">Contact Info</th>
<th colspan="3" class="tble_fb">Item Info</th>
<th colspan="3" class="tble_fb">Rent Period</th>
<th colspan="4" class="tble_fb">Delivery Info</th>
<th colspan="4" class="tble_fb">Pick Up Info</th>
<th colspan="1" class="tble_fb">Order Notes</th>
</tr>
<tr>
<td class="heading_cls">Date</td>
<td class="heading_cls">Day</td>
<td class="heading_cls">Order #</td>
<td class="heading_cls">New Order</td>
<td class="heading_cls">First Name</td>
<td class="heading_cls">Last Name</td>
<td class="heading_cls">Email</td>
<td class="heading_cls">Phone</td>
<td class="heading_cls">Secondary Phone</td>
<td class="heading_cls">Package</td>
<td class="heading_cls">Package Boxes</td>
<td class="heading_cls">Added Items</td>
<td class="heading_cls">Rent Period</td>
<td class="heading_cls">Rent Extra Week(s)</td>
<td class="heading_cls">Delivery Date</td>
<td class="heading_cls">Delivery Address</td>
<td class="heading_cls">Delivery Apt</td>
<td class="heading_cls">Stair/Elevator</td>
<td class="heading_cls">Pick Up Date</td>
<td class="heading_cls">Pick Up Address</td>
<td class="heading_cls">Pick Up Apt</td>
<td class="heading_cls">Stair/Elevator</td>
<td class="heading_cls">Order Notes</td>
</tr>
</thead>
<tbody>
<?php
$servername = "localhost";
$username = "xxxxx";
$password = "xxxx(*()";
$dbname = "xxxx";
date_default_timezone_set('Canada/Eastern');
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
@$month_year=$_REQUEST['month_year'];
if(@$_POST['cal_dat_get']){
$startdate = date("m/d/Y", strtotime($month_year));
}else{
$startdate = date("m/d/Y");
}
$exp = explode('/', $startdate);
$year = $exp[2];
$month = $exp[0];
$day_01 = '01';
for($day_01='01';$day_01<='31';$day_01++){
$tada_01 = $month.'/'.$day_01.'/'.$year;
if(@$_POST['cal_dat_get']){
$sql_package = "SELECT * from xxxx WHERE payment_status='succeeded' AND (order_status_type='New Order' OR order_status_type='Delivered') and order_date like '%$tada_01%' order by id desc";
}else{
$sql_package = "SELECT * from xxxxx WHERE payment_status='succeeded' AND (order_status_type='New Order' OR order_status_type='Delivered') and order_date like '%$tada_01%' order by id desc";
}
$result = $conn->query($sql_package);
$val_price = 0;
if ($result->num_rows > 0) {
while($row_pack = $result->fetch_assoc()) {
?>
<tr>
<td class="heading_cls"><?php echo $row_pack["first_name"]; ?></td>
<td class="heading_cls"><?php echo $row_pack["last_name"]; ?></td>
<td class="heading_cls"><?php echo $row_pack["email_personal"]; ?></td>
<td class="heading_cls"><?php echo $row_pack["phone_number1"]; ?></td>
</tr>
<?php
}
} else {
?>
<tr>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls"></td>
</tr>
<?php
}
}
?> </tbody>
</table>
<thead>
<tr>
<th colspan="2" class="tble_fb">Calender</th>
<th colspan="1" class="tble_fb">Order #</th>
<th colspan="1" class="tble_fb">Order Status</th>
<th colspan="5" class="tble_fb">Contact Info</th>
<th colspan="3" class="tble_fb">Item Info</th>
<th colspan="3" class="tble_fb">Rent Period</th>
<th colspan="4" class="tble_fb">Delivery Info</th>
<th colspan="4" class="tble_fb">Pick Up Info</th>
<th colspan="1" class="tble_fb">Order Notes</th>
</tr>
<tr>
<td class="heading_cls">Date</td>
<td class="heading_cls">Day</td>
<td class="heading_cls">Order #</td>
<td class="heading_cls">New Order</td>
<td class="heading_cls">First Name</td>
<td class="heading_cls">Last Name</td>
<td class="heading_cls">Email</td>
<td class="heading_cls">Phone</td>
<td class="heading_cls">Secondary Phone</td>
<td class="heading_cls">Package</td>
<td class="heading_cls">Package Boxes</td>
<td class="heading_cls">Added Items</td>
<td class="heading_cls">Rent Period</td>
<td class="heading_cls">Rent Extra Week(s)</td>
<td class="heading_cls">Delivery Date</td>
<td class="heading_cls">Delivery Address</td>
<td class="heading_cls">Delivery Apt</td>
<td class="heading_cls">Stair/Elevator</td>
<td class="heading_cls">Pick Up Date</td>
<td class="heading_cls">Pick Up Address</td>
<td class="heading_cls">Pick Up Apt</td>
<td class="heading_cls">Stair/Elevator</td>
<td class="heading_cls">Order Notes</td>
</tr>
</thead>
<tbody>
<?php
$servername = "localhost";
$username = "xxxxx";
$password = "xxxx(*()";
$dbname = "xxxx";
date_default_timezone_set('Canada/Eastern');
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
@$month_year=$_REQUEST['month_year'];
if(@$_POST['cal_dat_get']){
$startdate = date("m/d/Y", strtotime($month_year));
}else{
$startdate = date("m/d/Y");
}
$exp = explode('/', $startdate);
$year = $exp[2];
$month = $exp[0];
$day_01 = '01';
for($day_01='01';$day_01<='31';$day_01++){
$tada_01 = $month.'/'.$day_01.'/'.$year;
if(@$_POST['cal_dat_get']){
$sql_package = "SELECT * from xxxx WHERE payment_status='succeeded' AND (order_status_type='New Order' OR order_status_type='Delivered') and order_date like '%$tada_01%' order by id desc";
}else{
$sql_package = "SELECT * from xxxxx WHERE payment_status='succeeded' AND (order_status_type='New Order' OR order_status_type='Delivered') and order_date like '%$tada_01%' order by id desc";
}
$result = $conn->query($sql_package);
$val_price = 0;
if ($result->num_rows > 0) {
while($row_pack = $result->fetch_assoc()) {
?>
<tr>
<td class="heading_cls"><?php echo $row_pack["first_name"]; ?></td>
<td class="heading_cls"><?php echo $row_pack["last_name"]; ?></td>
<td class="heading_cls"><?php echo $row_pack["email_personal"]; ?></td>
<td class="heading_cls"><?php echo $row_pack["phone_number1"]; ?></td>
</tr>
<?php
}
} else {
?>
<tr>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls" style="border-right: none;"></td>
<td class="heading_cls"></td>
</tr>
<?php
}
}
?> </tbody>
</table>
No comments:
Post a Comment