Guest User

related

a guest
Dec 12th, 2016
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.14 KB | None | 0 0
  1. foreach($order as $orderData)
  2. {
  3. $k = 0;
  4. $orderitems = $orderData['dproduct_id'];
  5. $orderitemsarray = explode(",", $orderitems);
  6.  
  7. $oDate = new DateTime($orderData['created_at']);
  8. $sDate = $oDate->format("M d, Y");
  9.  
  10. while ($k < count($orderitemsarray))
  11. {
  12.  
  13. if ($orderitemsarray[$k] != '0')
  14. {
  15. $stmtorders = $user_home->runQuery("SELECT * FROM order_details");
  16. //$stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
  17. $stmtorders->execute(array(":dorder_id" => $orderData['entity_id']));
  18.  
  19.  
  20. $roworders = $stmtorders->fetch(PDO::FETCH_ASSOC);
  21.  
  22.  
  23.  
  24. if($data['type']=="admin")continue;
  25.  
  26. if($data['dpaid_status']=='P'){$dorderStatus='Paid';}
  27. if($data['dpaid_status']=='U'){$dorderStatus='Unpaid';}
  28. if($data['dpaid_status']=='R'){$dorderStatus='Returned';}
  29. if($data['dpaid_status']==''){$dpaid_status='';}
  30.  
  31. if ($roworders[
  32.  
  33. 'dproduct_id'] == '')
  34. {
  35. $dorderStatus = "Unpaid";
  36. }
  37. else
  38. {
  39. $dorderStatus = $roworders['dpaid_status'];
  40. }
  41.  
  42. if ($roworders['dproduct_id'] == '')
  43. {
  44. $commission = "comm";
  45. }
  46. else
  47. {
  48. $commission = $roworders['commission'];
  49. }
  50.  
  51. $productdetail = Mage::getModel('catalog/product')->load($orderitemsarray[$k]);
  52. $designer_id = $productdetail->getDesignerID() ;
  53.  
  54. if($accountType == "admin"){
  55. $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
  56. $responce[] = array(
  57. $orderData->getIncrementId() ,
  58. $orderData->getIncrementId() ,
  59. $orderitemsarray[$k],
  60. $productdetail->getName() ,
  61. $designerName,
  62. $orderData['status'],
  63. $orderData['grand_total'],
  64. $orderData['customer_email'],
  65. $commission,
  66. $dorderStatus,
  67. $sDate
  68. );
  69.  
  70. }
  71.  
  72. else
  73.  
  74. {
  75.  
  76. if( $designer_id== $_SESSION['userSession'] ){
  77. $designerName = getDesignerName($productdetail->getDesignerID()) . " -(" . $productdetail->getDesignerID() . ")";
  78. $responce[] = array(
  79. $orderData->getIncrementId() ,
  80. $orderData->getIncrementId() ,
  81. $orderitemsarray[$k],
  82. $productdetail->getName() ,
  83. $designerName,
  84. $orderData['status'],
  85. $orderData['grand_total'],
  86. $orderData['customer_email'],
  87. $commission,
  88. $dorderStatus,
  89. $sDate
  90. );
  91. }
  92. }
  93. }
Add Comment
Please, Sign In to add comment