Example #1
0
function assign_TicketDelivery(&$pDB)
{
    // collect parameters
    $sTicketId = trim(getParameter('ticket_id'));
    $sUserId = trim(getParameter('user_id'));
    $sNote = trim(getParameter('note'));
    $response = array('action' => 'assign', 'message' => 'Phân công mã giao vé ' . $sTicketId . ' thành công');
    $pTicket_Delivery = new Ticket_Delivery($pDB);
    $result = $pTicket_Delivery->assignDelivery($sTicketId, $sUserId, $sNote);
    // return json
    if (!$result) {
        $response['action'] = 'error';
        $response['message'] = 'Lỗi: ' . $pTicket_Delivery->errMsg;
    }
    $json = new Services_JSON();
    Header('Content-Type: application/json');
    return $json->encode($response);
}
Example #2
0
    // address_book
    $padress_book = new paloAdressBook($pDB);
    $arrBooker = $padress_book->getAgentList();
    echo $json->encode($arrBooker);
    return;
}
/* end of get booker list */
/* get delivery man */
if (isset($_REQUEST['delivery_man_list'])) {
    $module_name = 'ticket_delivery';
    $arrConf['cadena_dsn'] = "mysql://*****:*****@localhost/call_center";
    include_once "/var/www/html/modules/{$module_name}/libs/Ticket_Delivery.class.php";
    include_once "/var/www/html/libs/paloSantoDB.class.php";
    $pDB = new paloDB($arrConf['cadena_dsn']);
    // address_book
    $pTicket_Delivery = new Ticket_Delivery($pDB);
    $delivery_man_list = $pTicket_Delivery->getDeliveryMan();
    echo $json->encode($delivery_man_list);
    return;
}
/* end of get booker list */
include_once "delivery_status.php";
global $db;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = '******';
$db['default']['password'] = "******";
$db['default']['database'] = "call_center";
$page = isset($_POST['page']) ? $_POST['page'] : 1;
$rp = isset($_POST['rp']) ? $_POST['rp'] : 10;
$sortname = isset($_POST['sortname']) ? $_POST['sortname'] : 'id';
$sortorder = isset($_POST['sortorder']) ? $_POST['sortorder'] : 'desc';
Example #3
0
function view_delivery()
{
    $response = array('action' => 'viewDelivery', 'message' => '(no message)');
    $ticket_id = getParameter('view_delivery_id');
    global $arrConf;
    $oMainConsole = new getInfoMainConsole();
    $oMainConsole->callcenter_db_connect($arrConf['cadena_dsn']);
    $delivery = $oMainConsole->getDeliveryById($ticket_id);
    if (!$delivery) {
        $response['action'] = 'error';
        $response['message'] = 'Lỗi kết nối dữ liệu';
    }
    $oMainConsole->callcenter_db_disconnect();
    // get history log
    include_once "modules/ticket_delivery/libs/Ticket_Delivery.class.php";
    $pDB = new paloDB($arrConf['cadena_dsn']);
    $pTicketExpand = new Ticket_Delivery($pDB);
    $arrLog = $pTicketExpand->getTicketLog($ticket_id);
    //return json
    $response['message'] = $delivery;
    $response['log'] = $arrLog;
    $json = new Services_JSON();
    Header('Content-Type: application/json');
    return $json->encode($response);
}
Example #4
0
function html_ticket($ticket_id, $pDB)
{
    $pTicket_Delivery = new Ticket_Delivery($pDB);
    $arrResult = $pTicket_Delivery->getTicket_DeliveryById($ticket_id);
    $count = 0;
    $ticket = '';
    foreach ($arrResult[0]['ticket_code'] as $code) {
        if ($count == count($arrResult[0]['ticket_code']) - 1) {
            $ticket .= $code;
        } else {
            $ticket .= $code . '<br/>';
        }
        $count++;
    }
    $html = '<p><table>
    <tr>
        <td width="20%"><img src="images/logo.png" alt="test alt attribute" border="0" /></td>
        <td width="65%">
            <b>Công ty TNHH XD-TM-DL Hồng Ngọc Hà</b><br/>&nbsp;
            CN1 : 178 Lê Thánh Tôn, Q1, TP HCM -  Hotline: (08)38 273 880<br/>&nbsp;
            CN2: 268 Cô Bắc Q1, TP HCM - Hotline: (08) 38 365 318
        </td>
        <td width="15%">
            STT: <b>' . $ticket_id . '</b>
        </td>
    </tr>
    </table>
    <br/>
    <h2 style="text-align:center;">PHIẾU GIAO VÉ KIÊM PHIẾU THU</h2>
    <table cellpadding="5">
    <tbody>
        <tr>
            <td width="18%"><b>Khách hàng:</b></td>
            <td width="22%">' . $arrResult[0]['customer_name'] . '</td>
            <td width="20%"><b>Địa chỉ:</b></td>
            <td width="50%">' . $arrResult[0]['deliver_address'] . '</td>
        </tr>
        <tr>
            <td><b>Số điện thoại:</b></td>
            <td>' . $arrResult[0]['customer_phone'] . '</td>
            <td><b>Nhân viên:</b></td>
            <td>' . $arrResult[0]['agent_name'] . '</td>
        </tr>
        <tr>
            <td><b>Mã vé:</b></td>
            <td>' . $ticket . '</td>
            <td><b>Ngày xuất vé:</b></td>
            <td>' . date("d/m/Y", strtotime($arrResult[0]['purchase_date'])) . '</td>
        </tr>
        <tr>
            <td><b>Giá vé:</b></td>
            <td>' . $arrResult[0]['price'] . '</td>
            <td><b>Thuế:</b></td>
            <td>' . $arrResult[0]['tax'] . '</td>
        </tr>
        <tr>
            <td><b>Tỉ giá:</b></td>
            <td>' . $arrResult[0]['currency_rate'] . '</td>
        </tr>
        <tr>
            <td><b>Tổng cộng:</b></td>
            <td>' . $arrResult[0]['pay_amount'] . '</td>
        </tr>
    </tbody></table><br/>
    <br/>
    <table>
        <tbody>
        <tr>
            <td align="center">
                Người giao
            </td>
            <td align="center">
                Người nhận
            </td>
        </tr>
        </tbody>
    </table>
    <br/><br/><br/><br/><br/><br/>
    <hr></p>
	<br/>
    <p><table>
    <tr>
        <td width="20%"><img src="images/logo1.png" alt="test alt attribute" border="0" /></td>
        <td width="65%">
            <b>Công ty TNHH XD-TM-DL Hồng Ngọc Hà</b><br/>&nbsp;
            CN1 : 178 Lê Thánh Tôn, Q1, TP HCM -  Hotline: (08)38 273 880<br/>&nbsp;
            CN2: 268 Cô Bắc Q1, TP HCM - Hotline: (08) 38 365 318
        </td>
        <td width="15%">
            STT: <b>' . $ticket_id . '</b>
        </td>
    </tr>
    </table>
    <br/>
    <h2 style="text-align:center;">PHIẾU GIAO VÉ KIÊM PHIẾU THU</h2>
    <table cellpadding="5">
    <tbody>
        <tr>
            <td width="18%"><b>Khách hàng:</b></td>
            <td width="22%">' . $arrResult[0]['customer_name'] . '</td>
            <td width="20%"><b>Địa chỉ:</b></td>
            <td width="50%">' . $arrResult[0]['deliver_address'] . '</td>
        </tr>
        <tr>
            <td><b>Số điện thoại:</b></td>
            <td>' . $arrResult[0]['customer_phone'] . '</td>
            <td><b>Nhân viên:</b></td>
            <td>' . $arrResult[0]['agent_name'] . '</td>
        </tr>
        <tr>
            <td><b>Mã vé:</b></td>
            <td>' . $ticket . '</td>
            <td><b>Ngày đặt vé:</b></td>
            <td>' . date("d/m/Y", strtotime($arrResult[0]['purchase_date'])) . '</td>
        </tr>
        <tr>
            <td><b>Giá vé:</b></td>
            <td>' . $arrResult[0]['price'] . '</td>
            <td><b>Thuế:</b></td>
            <td>' . $arrResult[0]['tax'] . '</td>
        </tr>
        <tr>
            <td><b>Tỉ giá:</b></td>
            <td>' . $arrResult[0]['currency_rate'] . '</td>
        </tr>
        <tr>
            <td><b>Tổng cộng:</b></td>
            <td>' . $arrResult[0]['pay_amount'] . '</td>
        </tr>
    </tbody></table><br/>
    <br/>
    <table>
        <tbody>
        <tr>
            <td align="center">
                Người giao
            </td>
            <td align="center">
                Người nhận
            </td>
        </tr>
        </tbody>
    </table>
    <br/><br/><br/><br/><br/>
    </p>';
    return $html;
}