0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
ACCOUNTS
/
[
Home
]
File: ac_add_voucher_cntrl.php
<?php include_once( "../lib/config.php"); //require_once "../model/Notification_mdl.php"; require_once BASE_DIR."/lib/db/connection.php"; require_once "../model/uploader_mdl.php"; require_once "../model/defaultValues_mdl.php"; require_once "ac_models.php"; $project_details = CommonModel::getProjects(); $pending_projets = array(); if (is_array($project_details) && !empty($project_details)) { reset($project_details); $first_key = key($project_details); $debit_head_details = Ac_Models::getBudgetHead($first_key); } //else //{ //$first_key = key($project_details); //$debit_head_details= Ac_Models::getBudgetHead($first_key);} // $installment_details= Pi_Models::getInstallmentDetails($first_key); if(isset($_POST['save'])) { // 1 $error_flag=0; $project_id= @$_POST['project_id']; $date_current= @$_POST['date_current']; $debit_head=@$_POST['debit_head']; $invoice_date=@$_POST['invoice_date']; $invoice_number=@$_POST['invoice_number']; $amount= @$_POST['amount']; if($project_id=="") { $error['project_id']="Please Enter Projectcode"; $error_flag=1; } $post = @$_POST; $post['date_current'] = date("Y-m-d"); if(!empty($post['invoice_date'])) $post['invoice_date'] = "0000-00-00"; $post['invoice_date'] = date("Y-m-d" ,strtotime($post['invoice_date']) ); $post['created_on'] = date("Y-m-d H:i:s"); $u_id=@$_SESSION['user_id']; $post['created_by'] = $u_id; $post['status'] = "VERIFIED"; $post['amount_init'] = $post['amount']; if($debit_head == 1){ unset($post['invoice_date']); unset($post['invoice_number']); } unset($post['save']); $result=Ac_Models::addBudgetHead($post); if(!$result){ $message="Try Again"; $key = "error"; }else{ $message = "Successfully inserted"; $key = "message"; } $url=$server_ip."/accounts/ac_add_voucher.php?$key=$message"; echo "<script>window.location='$url'</script>"; } ?>