diff --git a/application/controllers/cashbook.php b/application/controllers/cashbook.php index 2f8bed90..4083ba4b 100755 --- a/application/controllers/cashbook.php +++ b/application/controllers/cashbook.php @@ -22,6 +22,7 @@ class cashbook extends BaseController $this->isLoggedIn(); $this->load->helper(array('form','url')); $this->load->library('upload'); + } @@ -1706,5 +1707,35 @@ $amountInWords = "Rupees " . $result ." Paise ". $points." Only"; return $amountInWords; } + + + + public function addNewSupplierCash() + { + $this->load->model('supplier_model'); + $suppliername = $this->input->post('suppliername'); + $contact = $this->input->post('contact'); + $alternatecont = $this->input->post('alternatecont'); + $email = $this->input->post('email'); + $Address = $this->input->post('Address'); + + $suparray = array('suppliername'=>$suppliername,'Address'=>$Address,'ContactNumber'=>$contact,'AlternateContactNumber'=>$alternatecont,'EmailAddress'=>$email ); + + $result = $this->supplier_model->addNewsupplier($suparray); + if($result > 0) + { + + echo "New Supplier Created successfully!"; + redirect('addnewIncomeExpense','refresh'); + } + + else + { + + echo "Supplier Record Not Created!"; + redirect('addnewIncomeExpense','refresh'); + } + } + } ?> \ No newline at end of file diff --git a/application/models/supplier_model.php b/application/models/supplier_model.php index c657b5db..66e3cde2 100755 --- a/application/models/supplier_model.php +++ b/application/models/supplier_model.php @@ -86,26 +86,37 @@ class supplier_model extends CI_Model return $query->result_array(); } - } + } + + - - function addNewsupplier($supplier) - { +{ - $this->db->insert('T_SupplierDetailsN', $supplier); - $SID = $this->db->affected_rows(); - - // if($SID>0) - // { - // $subQuery = 'select max(SupplierID) as suppid from T_SupplierDetailsN'; - // $query = $this->db->query($subQuery); - // return $query->result(); - // } - return $SID; + $this->db->insert('T_SupplierDetailsN', $supplier); + $SID = $this->db->affected_rows(); + return $SID; - } +} + + + +// function addNewsupplier($supplier) +// { + +// $this->db->insert('T_SupplierDetailsN', $supplier); +// $SID = $this->db->affected_rows(); + +// // if($SID>0) +// // { +// // $subQuery = 'select max(SupplierID) as suppid from T_SupplierDetailsN'; +// // $query = $this->db->query($subQuery); +// // return $query->result(); +// // } +// return $SID; + +// } /** * This function used to get user information by id diff --git a/application/views/addnewIncomeExpense.php b/application/views/addnewIncomeExpense.php index a5d40702..697e8cf6 100755 --- a/application/views/addnewIncomeExpense.php +++ b/application/views/addnewIncomeExpense.php @@ -119,17 +119,43 @@ function loadAccountType(id) /* background-color: darkgrey; */ outline: 1px solid slategrey; } + + .modal +{ + padding-right:25% ! important; +} +.dataTables_paginate +{ + margin-top: -5%; +} +.dataTables_wrapper { + padding-bottom: 0px; +} +.badge + { + color:red; background-color:#fff; + } + + legend{ + color:#00c0ef ! important; + } + + .content { + Padding:0% ! important; +}
+

Siddharth Industries - Add New Receipt and Payment

+
Back
@@ -197,11 +223,80 @@ function loadAccountType(id) Select Supplier: *

+
+
+Add Line Item + +
+
+ + + + +
@@ -530,4 +625,184 @@ $(document).ready(function(){ } }); }); + + + + +$('#supplier').change(function() { + + var drpval = $('#supplier').val(); + if(drpval == 1) + { + //alert() + $('#Addsup').modal('show'); + } + +}); + + +function onlyAlphabets(evt) +{ + var charCode; + if (window.event) + charCode = window.event.keyCode; //for IE + else + charCode = evt.which; //for firefox + if (charCode == 32) //for <space> symbol + return true; + if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table + return false; + if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table + return false; + if (charCode > 122) //for characters beyond 'z' in ASCII Table + return false; + return true; +} + +function getContactNumberValidation() +{ + + var contactNumber = $('#ContactNumber').val(); + var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber); + var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber); + var mobilephone = /^[0-9]{10,12}$/.test(contactNumber); + + if(contactNumber!='') + { + + if(telephone) + { + + return true; + } + + else if(regex) + { + + return true; + } + else if(mobilephone) + { + + return true; + } + + else + { + alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210'); + return false; + } + } + else + { + + alert('please correct format of contact number'); + return false; + } + } + + + + function isNumberKey(evt) + { + var charCode = (evt.which) ? evt.which : evt.keyCode; + if (charCode != 46 && charCode != 32 && charCode >= 33 + && (charCode < 48 || charCode > 57)) + return false; + + return true; + } + + function validateEmail() { + var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; + + var email = $('#emailid').val(); + + if(email != '') + { + if (reg.test(email) == false) + { + alert('Please Enter Valid Email Address'); + return (false); + } + else + { + return true; + } + } + else + { + alert('Please Enter email id'); + } + +} + + +function validatesup() +{ + // var a= $('#supplierName').val(); + // alert(a); + + if($("#supplierName").val().length < 1) + { + alert('Please Enter Supplier Name'); + $("#supplierName").focus(); + return false; + } + + if(!getContactNumberValidation()) + { + $("#ContactNumber").focus(); + return false; + } + + if(!validateEmail()) + { + $('#emailid').focus(); + return false; + } + + if($("#Address").val().length < 1) + { + alert('Please Enter Address'); + $("#Address").focus(); + return false; + } + + else + { + return true; + } +} + + +$('.AddSupplier').click(function() +{ + if(validatesup()) + { + var suppliername = $('#supplierName').val(); + var contact = $('#ContactNumber').val(); + var alternatecont = $('#AlternateContactNumber').val(); + var email = $('#emailid').val(); + var Address = $('#Address').val(); + $('#content').loader('show'); + $.ajax({ + + data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address}, + type:"POST", + url:"cashbook/addNewSupplierCash", + + success:function(data) + { + $('#content').loader('hide'); + alert(data); + location.reload(); + + } + + }); + + + } +}); \ No newline at end of file diff --git a/application/views/bankcashnew.php b/application/views/bankcashnew.php index 2d96d972..b60edd23 100644 --- a/application/views/bankcashnew.php +++ b/application/views/bankcashnew.php @@ -269,12 +269,37 @@ else /* background-color: darkgrey; */ outline: 1px solid slategrey; } + +.modal +{ + padding-right:25% ! important; +} +.dataTables_paginate +{ + margin-top: -5%; +} +.dataTables_wrapper { + padding-bottom: 0px; +} +.badge + { + color:red; background-color:#fff; + } + + legend{ + color:#00c0ef ! important; + } + + .content { + Padding:0% ! important; +}
+
Back
@@ -387,10 +412,85 @@ else
Select Supplier: *

+ + + + + + +
+
+Add Line Item + +
+
+ + + + +
Total Amount:*

@@ -694,6 +794,184 @@ function calculateTotal() // }); + +$('#supplier').change(function() { + + var drpval = $('#supplier').val(); + if(drpval == 1) + { + //alert() + $('#Addsup').modal('show'); + } + +}); + + +function onlyAlphabets(evt) +{ + var charCode; + if (window.event) + charCode = window.event.keyCode; //for IE + else + charCode = evt.which; //for firefox + if (charCode == 32) //for <space> symbol + return true; + if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table + return false; + if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table + return false; + if (charCode > 122) //for characters beyond 'z' in ASCII Table + return false; + return true; +} + +function getContactNumberValidation() +{ + + var contactNumber = $('#ContactNumber').val(); + var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber); + var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber); + var mobilephone = /^[0-9]{10,12}$/.test(contactNumber); + + if(contactNumber!='') + { + + if(telephone) + { + + return true; + } + + else if(regex) + { + + return true; + } + else if(mobilephone) + { + + return true; + } + + else + { + alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210'); + return false; + } + } + else + { + + alert('please correct format of contact number'); + return false; + } + } + + + + function isNumberKey(evt) + { + var charCode = (evt.which) ? evt.which : evt.keyCode; + if (charCode != 46 && charCode != 32 && charCode >= 33 + && (charCode < 48 || charCode > 57)) + return false; + + return true; + } + + function validateEmail() { + var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; + + var email = $('#emailid').val(); + + if(email != '') + { + if (reg.test(email) == false) + { + alert('Please Enter Valid Email Address'); + return (false); + } + else + { + return true; + } + } + else + { + alert('Please Enter email id'); + } + +} + + +function validatesup() +{ + // var a= $('#supplierName').val(); + // alert(a); + + if($("#supplierName").val().length < 1) + { + alert('Please Enter Supplier Name'); + $("#supplierName").focus(); + return false; + } + + if(!getContactNumberValidation()) + { + $("#ContactNumber").focus(); + return false; + } + + if(!validateEmail()) + { + $('#emailid').focus(); + return false; + } + + if($("#Address").val().length < 1) + { + alert('Please Enter Address'); + $("#Address").focus(); + return false; + } + + else + { + return true; + } +} + + +$('.AddSupplier').click(function() +{ + if(validatesup()) + { + var suppliername = $('#supplierName').val(); + var contact = $('#ContactNumber').val(); + var alternatecont = $('#AlternateContactNumber').val(); + var email = $('#emailid').val(); + var Address = $('#Address').val(); + $('#content').loader('show'); + $.ajax({ + + data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address}, + type:"POST", + url:"cashbook/addNewSupplierCash", + + success:function(data) + { + $('#content').loader('hide'); + alert(data); + location.reload(); + + } + + }); + + + } +}); + diff --git a/application/views/editincomeexpenses.php b/application/views/editincomeexpenses.php index e04e4738..58ffd591 100755 --- a/application/views/editincomeexpenses.php +++ b/application/views/editincomeexpenses.php @@ -72,6 +72,31 @@ if(!empty($DepDetails)) /* background-color: darkgrey; */ outline: 1px solid slategrey; } + + + .modal +{ + padding-right:25% ! important; +} +.dataTables_paginate +{ + margin-top: -5%; +} +.dataTables_wrapper { + padding-bottom: 0px; +} +.badge + { + color:red; background-color:#fff; + } + + legend{ + color:#00c0ef ! important; + } + + .content { + Padding:0% ! important; +}
+

Siddharth Industries - Edit Receipt and Payment

@@ -398,10 +424,81 @@ function loadAccountType(id) Select Supplier: *

+ + +
+
+Add Line Item + +
+
+ + + + +
@@ -510,11 +607,12 @@ function loadAccountType(id)
- Description: + Description: - +
@@ -770,4 +868,185 @@ $('#myradio2').click(function(){ $('#towhom').text('Paid To:'); }); + + +$('#supplier').change(function() { + + var drpval = $('#supplier').val(); + if(drpval == 1) + { + //alert() + $('#Addsup').modal('show'); + } + +}); + + +function onlyAlphabets(evt) +{ + var charCode; + if (window.event) + charCode = window.event.keyCode; //for IE + else + charCode = evt.which; //for firefox + if (charCode == 32) //for <space> symbol + return true; + if (charCode > 31 && charCode < 65) //for characters before 'A' in ASCII Table + return false; + if (charCode > 90 && charCode < 97) //for characters between 'Z' and 'a' in ASCII Table + return false; + if (charCode > 122) //for characters beyond 'z' in ASCII Table + return false; + return true; +} + +function getContactNumberValidation() +{ + + var contactNumber = $('#ContactNumber').val(); + var telephone =/^[0-9]{3,4}\s[0-9]{8,9}$/.test(contactNumber); + var regex = /^[0-9]{4,6}\s[0-9]{5,7}$/.test(contactNumber); + var mobilephone = /^[0-9]{10,12}$/.test(contactNumber); + + if(contactNumber!='') + { + + if(telephone) + { + + return true; + } + + else if(regex) + { + + return true; + } + else if(mobilephone) + { + + return true; + } + + else + { + alert('Please Enter valid Contact Number ex: 044 12345678 , 0444 1234567,04444 123456 and 9876543210'); + return false; + } + } + else + { + + alert('please correct format of contact number'); + return false; + } + } + + + + function isNumberKey(evt) + { + var charCode = (evt.which) ? evt.which : evt.keyCode; + if (charCode != 46 && charCode != 32 && charCode >= 33 + && (charCode < 48 || charCode > 57)) + return false; + + return true; + } + + function validateEmail() { + var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; + + var email = $('#emailid').val(); + + if(email != '') + { + if (reg.test(email) == false) + { + alert('Please Enter Valid Email Address'); + return (false); + } + else + { + return true; + } + } + else + { + alert('Please Enter email id'); + } + +} + + +function validatesup() +{ + // var a= $('#supplierName').val(); + // alert(a); + + if($("#supplierName").val().length < 1) + { + alert('Please Enter Supplier Name'); + $("#supplierName").focus(); + return false; + } + + if(!getContactNumberValidation()) + { + $("#ContactNumber").focus(); + return false; + } + + if(!validateEmail()) + { + $('#emailid').focus(); + return false; + } + + if($("#Address").val().length < 1) + { + alert('Please Enter Address'); + $("#Address").focus(); + return false; + } + + else + { + return true; + } +} + + + +$('.AddSupplier').click(function() +{ + if(validatesup()) + { + var suppliername = $('#supplierName').val(); + var contact = $('#ContactNumber').val(); + var alternatecont = $('#AlternateContactNumber').val(); + var email = $('#emailid').val(); + var Address = $('#Address').val(); + $('#content').loader('show'); + $.ajax({ + + data:{suppliername:suppliername,contact:contact,alternatecont:alternatecont,email:email,Address:Address}, + type:"POST", + url:"cashbook/addNewSupplierCash", + + success:function(data) + { + $('#content').loader('hide'); + alert(data); + location.reload(); + + } + + }); + + + } +}); + + \ No newline at end of file