Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- foreach($order as $orderData)
- {
- $k = 0;
- $orderitems = $orderData['dproduct_id'];
- $orderitemsarray = explode(",", $orderitems);
- $oDate = new DateTime($orderData['created_at']);
- $sDate = $oDate->format("M d, Y");
- while ($k < count($orderitemsarray))
- {
- if ($orderitemsarray[$k] != '0')
- {
- $stmtorders = $user_home->runQuery("SELECT * FROM order_details");
- //$stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
- $stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
- $roworders = $stmtorders->fetch(PDO::FETCH_ASSOC);
- if($data['type']=="admin")continue;
- if($data['dpaid_status']=='P'){$dorderStatus='Paid';}
- if($data['dpaid_status']=='U'){$dorderStatus='Unpaid';}
- if($data['dpaid_status']=='R'){$dorderStatus='Returned';}
- if($data['dpaid_status']==''){$dpaid_status='';}
- if ($roworders[
- 'dproduct_id'] == '')
- {
- $dorderStatus = "Unpaid";
- }
- else
- {
- $dorderStatus = $roworders['dpaid_status'];
- }
- if ($roworders['dproduct_id'] == '')
- {
- $commission = "comm";
- }
- else
- {
- $commission = $roworders['commission'];
- }
- $productdetail = Mage::getModel('catalog/product')->load($orderitemsarray[$k]);
- $designer_id = $productdetail->getDesignerID() ;
- if($accountType == "admin"){
- $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
- $responce[] = array(
- $orderData->getIncrementId() ,
- $orderData->getIncrementId() ,
- $orderitemsarray[$k],
- $productdetail->getName() ,
- $designerName,
- $orderData['status'],
- $orderData['grand_total'],
- $orderData['customer_email'],
- $commission,
- $dorderStatus,
- $sDate
- );
- }
- else
- {
- if( $designer_id== $_SESSION['userSession'] ){
- $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
- $responce[] = array(
- $orderData->getIncrementId() ,
- $orderData->getIncrementId() ,
- $orderitemsarray[$k],
- $productdetail->getName() ,
- $designerName,
- $orderData['status'],
- $orderData['grand_total'],
- $orderData['customer_email'],
- $commission,
- $dorderStatus,
- $sDate
- );
- }
- }
- }
Add Comment
Please, Sign In to add comment