Пример #1
0
 function PayWhenDeliveryDone()
 {
     $result['status'] = 'done';
     /*одготавливаем письмицо в конверте
       1 - заказчику
       2 - администратору
       */
     //$this->ClearCard();
     $card = $this->GetCard();
     print_r($card);
     $products = '';
     $summa = 0;
     foreach ($card as $product) {
         $products .= $product->id . "-" . $product->CardCount . "||";
         $summa += $product->TV['Price'] * $product->CardCount;
     }
     $user_delivery_address = mysql_escape_string($_GET['user_delivery_address']);
     $user_email = mysql_escape_string($_GET['user_email']);
     $user_name = mysql_escape_string($_GET['user_name']);
     $user_phone = mysql_escape_string($_GET['user_phone']);
     $obj = new stdClass();
     $obj->pagetitle = "z_" . rand(5, 60) . "_" . $user_name . "-" . $user_phone;
     $obj->parent = $this->z_parent;
     $obj->template = $this->z_template;
     $obj->TV['z_user_email'] = $user_email;
     $obj->TV['z_user_name'] = $user_name;
     $obj->TV['z_user_phone'] = $user_phone;
     $obj->TV['z_user_delivery_address'] = $user_delivery_address;
     $obj->TV['z_order_product_list'] = $products;
     $obj->TV['z_summa'] = $summa;
     $obj->alias = encodestring($obj->pagetitle);
     $obj->url = "zakazyi/" . $obj->alias . ".html";
     //echo json_encode($card);
     $order_id = IncertPage($obj);
     /*Получаем тело письма из шаблона*/
     include "tpl/tplCustomerEmail.php";
 }
Пример #2
0
 function z_add()
 {
     $obj = new stdClass();
     $today = date("Y-m-d H:i:s");
     echo $today;
     $obj->parent = $this->ZayavkaParent;
     $obj->template = $this->ZayavkaTemplate;
     $obj->TV['z_cauta_nomer'] = $_GET['z_cauta_nomer'];
     $obj->TV['z_cruis_id'] = $_GET['z_cruis_id'];
     $obj->TV['z_info'] = $_GET['z_info'];
     $obj->TV['z_user_email'] = $_GET['z_user_email'];
     $obj->TV['z_user_name'] = $_GET['z_user_name'];
     $obj->TV['z_user_phone'] = $_GET['z_user_phone'];
     $obj->TV['z_date'] = $today;
     $obj->TV['z_status'] = 'Новая';
     $cruis = GetPageInfo($obj->TV['z_cruis_id']);
     $ship = GetPageInfo($cruis->parent);
     $obj->TV['z_ship_id'] = $ship->id;
     $obj->pagetitle = "z_" . rand(5, 60) . "_" . $obj->TV['z_user_name'] . "_" . $obj->TV['z_ship_id'] . "_" . $obj->TV['z_cruis_id'] . "_" . $obj->TV['z_cauta_nomer'];
     //$obj->pagetitle=$ship;
     $obj->alias = encodestring($obj->pagetitle);
     $obj->url = "zayavki/" . $obj->alias . ".html";
     IncertPage($obj);
 }