diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 775001d0..7fdec737 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -299,9 +299,8 @@ class cashbook extends BaseController //echo $cashfile; //die(); //$this->load->model('cashbook_model'); - $this->cashbook_model->deletefile($cashid); - - //print_r( $data['DepDetails']);die(); + $filedata= $this->cashbook_model->deletefile($cashid); + echo $filedata; //$this->global['pageTitle'] = 'Siddharth : Edit Cashbook'; //$this->loadViews("income_expense_list", $this->global,$data, NULL); @@ -322,6 +321,11 @@ class cashbook extends BaseController //echo $option;die(); $ans1 = $this->input->post('ans'); $Date1 = $this->input->post('Date'); + //echo $Date1; + $date = date_create($Date1);//,'Y-m-d'); + $date = date_format($date,'Y-m-d'); + //echo $date; + //$Date1 = $this->input->post('Date'); $accountcode1 = $this->input->post('accode'); //echo $accountcode1;die(); $towhome1 = $this->input->post('towhome'); @@ -335,6 +339,10 @@ class cashbook extends BaseController $IGST1 = $this->input->post('IGST'); $totalamount1 = $this->input->post('totalamount'); $description1 = $this->input->post('description'); + $deleteflag = $this->input->post('deleteflag'); + $oldfile = $this->input->post('oldfile'); + $document =null; + //$document1=$this->input->post('myfile'); $fs = 0; if(!empty($_FILES['myfile']['name'])) @@ -344,13 +352,25 @@ class cashbook extends BaseController $config['upload_path'] = 'uploads/cashbook/'; $path = $config['upload_path']; //$filename = $config['file_name']; - $document = $path.$filename; + //$document = $path.$filename; //echo $document; $fs = $this->uploadFile(); $document = $path.$fs; + } - $updateaccount = array('type'=>$option,'account_code'=>$accountcode1,'date'=>$Date1,'towhom'=>$towhome1,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document); + else + { + if($deleteflag == 0) + { + $document = $oldfile; + } + else if($deleteflag == 1) + { + $document = null; + } + } + $updateaccount = array('type'=>$option,'account_code'=>$accountcode1,'date'=>$date,'towhom'=>$towhome1,'invoice_no'=>$Invoiceno1,'merchant'=>$merchant1,'merchant_gst'=>$Merchantgst1,'HSN'=>$hsn1,'value_before_gst'=>$valuebeforegST1,'sgst'=>$SGST1,'cgst'=>$CGST1,'igst'=>$IGST1,'total'=>$totalamount1,'description'=>$description1,'document'=>$document); //print_r($updateaccount);die(); $res = $this->cashbook_model->updatedepartment($updateaccount,$id1); @@ -384,21 +404,21 @@ $point=0; $i = 0; $str = array(); - $words = array('0' => '', '1' => 'one', '2' => 'two', - '3' => 'three', '4' => 'four', '5' => 'five', '6' => 'six', + $words = array('0' => '', '1' => 'One', '2' => 'Two', + '3' => 'three', '4' => 'Four', '5' => 'Five', '6' => 'Six', '7' => 'seven', '8' => 'eight', '9' => 'nine', '10' => 'ten', '11' => 'eleven', '12' => 'twelve', '13' => 'thirteen', '14' => 'fourteen', '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen', '18' => 'eighteen', '19' =>'nineteen', '20' => 'twenty', - '30' => 'thirty', '40' => 'fourty', '50' => 'fifty', + '30' => 'thirty', '40' => 'forty', '50' => 'fifty', '60' => 'sixty', '70' => 'seventy', '80' => 'eighty', '90' => 'ninety','06'=>'Zero Six','01'=>'Zero One','02'=>'Zero Two' ,'03'=>'Zero Three','04'=>'Zero Four','05'=>'Zero Five','07'=>'Zero Seven','08'=>'Zero Eight','09'=>'Zero Nine'); $words1 = array('2' => 'twenty', '3' => 'thirty', '4' => 'fourty', '5' => 'fifty', '6' => 'sixty', '7' => 'seventy', - '8' => 'eighty', '9' =>'ninety'); + '8' => 'eighty', '9' =>'ninty'); $words12 = array('11' => 'eleven', '12' => 'twelve', '13' => 'thirteen', '14' => 'fourteen', '15' => 'fifteen', '16' => 'sixteen', '17' => 'seventeen', diff --git a/application/logs/log-2017-12-20.php b/application/logs/log-2017-12-20.php index e1844ce5..54378d1f 100644 --- a/application/logs/log-2017-12-20.php +++ b/application/logs/log-2017-12-20.php @@ -140,3 +140,18 @@ ERROR - 2017-12-20 13:35:07 --> Severity: Notice --> Undefined index: dom /opt/ ERROR - 2017-12-20 13:35:07 --> Severity: Notice --> Undefined index: dom /opt/lampp/htdocs/siddharth_application/application/third_party/mpdf/mpdf.php 26073 ERROR - 2017-12-20 13:35:07 --> Severity: Notice --> Undefined index: dom /opt/lampp/htdocs/siddharth_application/application/third_party/mpdf/mpdf.php 26073 ERROR - 2017-12-20 13:35:07 --> Severity: 8192 --> Methods with the same name as their class will not be constructors in a future version of PHP; TTFontFile has a deprecated constructor /opt/lampp/htdocs/siddharth_application/application/third_party/mpdf/classes/ttfontsuni.php 51 +ERROR - 2017-12-20 15:48:46 --> Severity: Warning --> Missing argument 1 for cashbook::editcashbook(), called in C:\xampp\htdocs\siddharth_application\system\core\CodeIgniter.php on line 360 and defined C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 269 +ERROR - 2017-12-20 15:48:46 --> Severity: Notice --> Undefined variable: sid C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 272 +ERROR - 2017-12-20 15:49:06 --> Severity: Notice --> Use of undefined constant RECEIPT - assumed 'RECEIPT' C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 315 +ERROR - 2017-12-20 15:49:06 --> The upload path does not appear to be valid. +ERROR - 2017-12-20 15:49:47 --> Severity: Warning --> Missing argument 1 for cashbook::editcashbook(), called in C:\xampp\htdocs\siddharth_application\system\core\CodeIgniter.php on line 360 and defined C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 269 +ERROR - 2017-12-20 15:49:47 --> Severity: Notice --> Undefined variable: sid C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 272 +ERROR - 2017-12-20 15:49:58 --> Severity: Notice --> Use of undefined constant RECEIPT - assumed 'RECEIPT' C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 315 +ERROR - 2017-12-20 15:50:10 --> Severity: Warning --> Missing argument 1 for cashbook::editcashbook(), called in C:\xampp\htdocs\siddharth_application\system\core\CodeIgniter.php on line 360 and defined C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 269 +ERROR - 2017-12-20 15:50:10 --> Severity: Notice --> Undefined variable: sid C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 272 +ERROR - 2017-12-20 15:50:23 --> Severity: Notice --> Use of undefined constant RECEIPT - assumed 'RECEIPT' C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 315 +ERROR - 2017-12-20 15:50:31 --> Severity: Warning --> Missing argument 1 for cashbook::editcashbook(), called in C:\xampp\htdocs\siddharth_application\system\core\CodeIgniter.php on line 360 and defined C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 269 +ERROR - 2017-12-20 15:50:31 --> Severity: Notice --> Undefined variable: sid C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 272 +ERROR - 2017-12-20 15:50:45 --> Severity: Notice --> Use of undefined constant RECEIPT - assumed 'RECEIPT' C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 315 +ERROR - 2017-12-20 15:53:42 --> Severity: Warning --> Missing argument 1 for cashbook::editcashbook(), called in C:\xampp\htdocs\siddharth_application\system\core\CodeIgniter.php on line 360 and defined C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 269 +ERROR - 2017-12-20 15:53:42 --> Severity: Notice --> Undefined variable: sid C:\xampp\htdocs\siddharth_application\application\controllers\cashbook.php 272 diff --git a/application/models/cashbook_model.php b/application/models/cashbook_model.php index d33aaa17..31232138 100755 --- a/application/models/cashbook_model.php +++ b/application/models/cashbook_model.php @@ -64,7 +64,7 @@ class cashbook_model extends CI_Model } function viewdepartment($sid='') { - $sql="SELECT ie.*,ac.name FROM t_income_expense ie + $sql="SELECT ie.*,ac.name,date_format(ie.date,'%d-%m-%Y')as date FROM t_income_expense ie join t_accountcode ac on ac.code=ie.account_code WHERE ie.id = ?"; $query = $this->db->query($sql,array($sid)); @@ -81,7 +81,8 @@ class cashbook_model extends CI_Model $query = $this->db->query($sql,array($cashid)); //print_r($this->db->last_query()); //echo $sql; - return $query->result(); + $r = $this->db->affected_rows(); + return $r; } @@ -94,7 +95,6 @@ class cashbook_model extends CI_Model } - function Cashbook($cashbookdatas) { $code=$cashbookdatas['code']; diff --git a/application/views/addnewIncomeExpense.php b/application/views/addnewIncomeExpense.php index 1d352769..e997ba41 100755 --- a/application/views/addnewIncomeExpense.php +++ b/application/views/addnewIncomeExpense.php @@ -114,7 +114,7 @@ function loadAccountType(id) - Siddharth Industries - Add New Income and Expense + Siddharth Industries - Add New Receipt and Payment diff --git a/application/views/editincomeexpenses.php b/application/views/editincomeexpenses.php index 400e5b7e..09a21324 100755 --- a/application/views/editincomeexpenses.php +++ b/application/views/editincomeexpenses.php @@ -46,7 +46,7 @@ if(!empty($DepDetails)) $IGST1=$ded->igst; $Description1=$ded->description; $towhom1=$ded->towhom; - $file1=$ded->document; + //$file1=$ded->document; //echo $file1; }} ?> @@ -200,14 +200,14 @@ function loadAccountType(id) - Siddharth Industries - Edit Income and Expense + Siddharth Industries - Edit Receipt and Payment - Back + Back @@ -231,27 +231,27 @@ function loadAccountType(id) Select Accounut type: - + - - - + + + RECEIPT PAYMENT - - - + + + - + @@ -407,9 +407,15 @@ function loadAccountType(id) File Upload: - + + + + + + +