Esempio n. 1
0
     $output[] = '<tr>';
     $output[] = '<td>' . $item->name . '</td>';
     $output[] = '<td>' . $item->quantity . '</td>';
     $output[] = '</tr>';
     //Get item from store inventory ans save it in order summary
     $dbitem = db_getItemByName($item->name);
     $success = db_addOrderItem($dborder_id, $dbitem['id'], $item->quantity, $item->price);
     //Insert order summary for this item
     if (!$success) {
         array_push($purchaseFailed, $dbitem);
     }
 }
 $output[] = '</tbody>';
 $output[] = '</table>';
 //Send Email to customer
 $buyer = refactored_db_getUserById($dborder_userid);
 // Buyer Information: added by JAM - 06/18/2012
 //$profile_fields = profile_user_record($dborder_userid);  jh  7/13/2015 Note: need to look for a comparable function in efront.
 $data = new object();
 $data->userfullname = $buyer['name'] . " " . $buyer['surname'];
 $data->firstname = $buyer['name'];
 $data->lastname = $buyer['surname'];
 $data->email = $buyer['email'];
 $data->username = $buyer['login'];
 $data->password = '';
 //$buyer->password;
 $data->gender = "n/a";
 $data->skypeid = "n/a";
 $data->kaseyasalesrep = "n/a";
 $data->maintopic = "n/a";
 $data->typebundle = "n/a";
Esempio n. 2
0
 //$currentUser -> getRole($this -> getCurrentLesson());
 //echo "current user is: ".$currentUser;
 //echo "root path is: " . G_ROOTPATH;
 $orders = db_getOrders();
 //echo "TESTING mysql_result";
 //var_dump($orders);  //jh this displays the array contents
 //echo $orders=>['fields']=>['id'];
 //$row = mysqli_fetch_array($orders, MYSQLI_NUM);
 //$finfo = $orders->fetch_fields();
 //echo $finfo;
 //echo "END TESTING mysql_result";
 //echo $orders
 $formattedOrders = array();
 //	if (is_array($orders)) {
 foreach ($orders as $row) {
     $user = refactored_db_getUserById($row['userid']);
     $purchaseDate = date(DATE_ATOM, $row['purchasedate'] / 1000);
     /*
     if($row['ordernumber']=='IA55a4429095d17') {
         echo "user array for userid: " . $row['userid']." is ".PHP_EOL;
         var_dump($user);
     }
     */
     $o = array($row['id'], $row['ordernumber'], $user['name'], $purchaseDate, $row['lastmodification'], $row['fulfillmentorderstate'], $row['financialorderstate'], $row['total']);
     array_push($formattedOrders, $o);
 }
 //	}
 echo json_encode($formattedOrders);
 //	 echo("{'id':'1,'ordernumber':'11','username':'******','purchasedDate':'1','lastmodification':'1','fulfillmentorderstate':'test','financialorderstate':'test','total':'1'}");
 //Show details of every order which contain what items were purchased,
 //quantities, and price