$name = DB::getInstance()->get('suppliers', array('supplier_code', '=', $_POST["search"])); if (!$name->count()) { echo "<span class='status-not-available'> No supplier.</span>"; } else { $code = $_POST["search"]; } $arr = $dailysupply->myTotalSupplyOf6Months($supplier_code); $todaydate = date('Y-m-d'); $todaydate = substr($todaydate, 5, 7); // 2015-11-11 $datemonth = date('Y-m-d'); $datemonth = substr($datemonth, 0, 8); $datemonth = $datemonth . "01"; //2015-11-02 $sup_name = $supplier->search('supplier_code', $supplier_code, 'f_name') . " " . $supplier->search('supplier_code', $supplier_code, 'l_name'); $aprate = $update->search('settings', 'date', $datemonth, 'approx_rate'); $thismonthkgs = DB::getInstance()->Getsum('approved_kgs', 'daily_supply', $supplier_code); echo ' <dl class="dl-horizontal example1"> <p>Supplier details<p> <dt>Code: </dt> <dd>' . $supplier_code . '</dd> <dt>Name: </dt> <dd>' . $sup_name . '</dd> <dt>NIC NO: </dt> <dd>' . $supplier->search('supplier_code', $supplier_code, 'nic_no') . '</dd> <dt>Approximate tea Rate: </dt> <dd>Rs ' . $aprate . '</dd> <dt>Supply kgs: </dt> <dd>' . $thismonthkgs . ' Kg</dd> <dt>Total income: </dt>
</section> <!-- /.content --> </div> <!--/.col (left) --> </div> </div><!-- /.row --> </section> <!-- tab-1-1 END --> </div><!-- /.tab-pane --> <div class="tab-pane" id="tab_2-2"> <!-- http://www.johnmorrisonline.com/a-php-script-to-search-a-mysql-database/ http://www.vaaah.com/php/view/Search/29/How-to-search-and-retrieve-data-from-MySQL-database-using-PHP --> <?php $msg_id = Input::get('id'); $supplier_code = $update->search('message_temp', 'message_id', $msg_id, 'supplier_code'); require_once 'db/dbdailysupply.php'; $dailysupply = new DBDailySupply(); $arr = $dailysupply->myTotalSupplyOf6Months($supplier_code); $todaydate = date('Y-m-d'); $todaydate = substr($todaydate, 5, 7); // 2015-11-11 $sup_name = $supplier->search('supplier_code', $supplier_code, 'f_name') . " " . $supplier->search('supplier_code', $supplier_code, 'l_name'); $view = DB::getInstance()->getall("message_temp"); $datemonth = date('Y-m-d'); $datemonth = substr($datemonth, 0, 8); $datemonth = $datemonth . "01"; //2015-11-02 $thismonthkgs = DB::getInstance()->Getsum('approved_kgs', 'daily_supply', $supplier_code); $code = $supplier_code; $reqval = $update->search('message_temp', 'message_id', $msg_id, 'value');