Commit ee1e3aac by Jansa Jose

add to cart changes

parent d3c07698
......@@ -2809,7 +2809,65 @@
$result = $this->Vehicle_model->changeReminderStatus($postData);
echo json_encode($result);exit;
}
}
public function downloadOrdrDtls($order_id = ''){
if(empty($order_id)){
return;
}
$this->load->library("Pdf");
header('Content-type:application/json');
$headers = apache_request_headers();
$product_data = $this->Webservice_model->getOrderData($order_id);
$html = '<table style="width:100%">
<thead>
<tr>
<th>
<h4 style="color:#606161;text-align:left;padding-left:0px;padding-right:5px;margin:0px;padding-top:10px;padding-bottom: 10px;border-bottom:1px solid #a8a8a8;text-transform: uppercase;">evaluation</h4>
</th>
</tr>
</thead>
</table>
<table style="width:100% ; border-bottom:1px solid #a8a8a8;">
<tbody>
<tr>
<td style="padding:8px;padding-left: 0px;">
<p style="margin:0px;padding-top: 10px;padding-bottom:10px;font-size: 13px;">
helo hai how r u
</p>
</td>
</tr>
</tbody>
</table>';
$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('DcarFixers');
$pdf->SetTitle('Product Details');
$pdf->SetSubject('Summary');
$pdf->SetKeywords('PDF, record, Summary');
$pdf->setPrintHeader(false);
$pdf->setPrintFooter(false);
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
require_once(dirname(__FILE__).'/lang/eng.php');
$pdf->setLanguageArray($l);
}
$pdf->setFontSubsetting(true);
$pdf->SetFont('times', '', 10, '', true);
$pdf->AddPage();
$pdfConfig = array('enabled'=>true,'depth_w'=>0.2,'depth_h'=>0.2,
'color'=>array(196,196,196),'opacity'=>1,'blend_mode'=>'Normal');
$pdf->setTextShadow($pdfConfig);
$pdf->writeHTML($html, true, false, true, false, '');
ob_end_clean();
$pdf->Output('Record.pdf', 'I');
}
}
?>
......@@ -1022,7 +1022,7 @@ class Webservice_model extends CI_Model {
return $respArr;
}
$result = $this->db->query("SELECT TRANS.datetime,TRANS.amount,TRANS.status,PRD.product_id,
$result = $this->db->query("SELECT TRANS.datetime,TRANS.booking_id,TRANS.amount,TRANS.status,PRD.product_id,
PRD.product_name,PRD.short_description,PRD.part_id,ORDS.format_order_id,ORDS.quantity,ORDS.expected_delivery,ORDS.delivered,ORDS.status AS odr_status,PRDR.id AS review_id
FROM transaction TRANS
JOIN orders ORDS ON ORDS.order_id = TRANS.booking_id
......@@ -1260,9 +1260,14 @@ class Webservice_model extends CI_Model {
}
$postData['created_date'] = date('Y-m-d h:i:s');
if($this->db->insert('cart',$postData)){
$respArr['data'] = $this->db->insert_id();
$respArr['status'] = 'success';
$cartData = $this->db->get_where('cart',array('product_id'=>$postData['product_id'],'customer_id'=>$postData['customer_id']));
if($cartData->num_rows < 0 || empty($cartData = $cartData->row())){
if($this->db->insert('cart',$postData)){
$respArr['data'] = $this->db->insert_id();
$respArr['status'] = 'success';
}
}else{
$respArr['message'] = "Product Already Added to Cart";
}
return $respArr;
}
......@@ -1401,6 +1406,10 @@ class Webservice_model extends CI_Model {
}
return $respArr;
}
public function getOrderData($order_id){
return $this->db->get_where('orders',array('format_order_id'=>$order_id))->row();
}
}
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment