<?php // Includng configuration file include 'config/config.php'; //Check user is already login or not checkAuthentication(); $id = $_SESSION['adminid']; $product = new product(); $order = new order(); $cashmemo = new cashmemo(); if (isset($_GET['action']) && $_GET['action'] == 'suggestprod') { $keyword = $_GET['keyword']; $elementid = $_GET['id']; $string = ''; $autosuggpro = $product->getSearchProducts($keyword); if (is_array($autosuggpro)) { $string .= '<ul>'; foreach ($autosuggpro as $val) { $string .= '<li onClick="fillname(\'' . addslashes($val['name']) . '\',\'' . $elementid . '\');fillcode(\'' . addslashes($val['sku']) . '\',\'' . $elementid . '\');fillprice(\'' . addslashes($val['price']) . '\',\'' . $elementid . '\');" >' . $val['name'] . '</li>'; } $string .= '</ul>'; } else { $string .= '<li>No Record found</li></ul>'; } echo $string; exit; } elseif (isset($_GET['action']) && $_GET['action'] == 'suggestchalan') { $keyword = $_GET['chalan_no']; $string = ''; $autosuggpro = $order->getChalanOrders($keyword); if (is_array($autosuggpro)) {
<?php // Includng configuration file include 'config/config.php'; //Check user is already login or not checkAuthentication(); $id = $_SESSION['adminid']; $order = new invoice(); $product = new product(); $cashmemo = new cashmemo(); $customer = new customer(); if (isset($_GET['action']) && $_GET['action'] == 'new') { $smarty->assign('content', $smarty->fetch('searchcashmemoinvoice.tpl')); } else { if (isset($_GET['action']) && $_GET['action'] == 'invoicecashmemo') { $id = $_GET['id']; $orderdet = $order->getOrder($id); $orderitems = $order->getOrderItems($orderdet['id']); foreach ($orderitems as $key => $val) { $orderitems[$key]['price'] = $product->getProductPrice($val['sku']); } $customer = $order->getCustomer($orderdet['customer_id']); $smarty->assign('order', $orderdet); $smarty->assign('items', $orderitems); $smarty->assign('customer', $customer); $smarty->assign('billing', $order->getCustomerBilling($customer['id'])); $smarty->assign('shipping', $order->getCustomerShipping($customer['id'])); $smarty->assign('content', $smarty->fetch('cashmemoinvoice.tpl')); } elseif (isset($_POST['action']) && $_POST['action'] == 'cashmemoinvoice') { $id = $_POST['id']; $data = $_POST;