worked on business settings in master -vadivel J
This commit is contained in:
parent
6d46208131
commit
a9a71139f1
@ -132,29 +132,31 @@ class Companycontroller extends BaseController
|
||||
// {
|
||||
|
||||
|
||||
$file=$this->request->getFile('files');
|
||||
|
||||
$PictureName = $this->request->getPost('Image');
|
||||
|
||||
$ModifyPictureName = $this->request->getPost('ModifyImage');
|
||||
$Picture = "";
|
||||
$file = $this->request->getFile('ModifyImage');
|
||||
$ProfilePicPhoto = $this->request->getFile('photo');
|
||||
|
||||
|
||||
if ($PictureName != '') {
|
||||
if ($file !== null && $file->isValid() && !$file->hasMoved()) {
|
||||
if ($ProfilePicPhoto !== null && $ProfilePicPhoto->isValid() && !$ProfilePicPhoto->hasMoved()) {
|
||||
$path = ROOTPATH.'public/uploads/images/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
$Picture = $ProfilePicPhoto->getName();
|
||||
$ProfilePicPhoto->move($path,$Picture);
|
||||
}else{
|
||||
$Picture = $PictureName;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($file !== null && $file->isValid() && !$file->hasMoved()) {
|
||||
if ($ProfilePicPhoto !== null && $ProfilePicPhoto->isValid() && !$ProfilePicPhoto->hasMoved()) {
|
||||
$path = ROOTPATH.'public/uploads/images/';
|
||||
if(!is_dir($path)) { mkdir($path, 0777, true); }
|
||||
$Picture = $file->getName();
|
||||
$file->move($path,$Picture);
|
||||
$Picture = $ProfilePicPhoto->getName();
|
||||
$ProfilePicPhoto->move($path,$Picture);
|
||||
}
|
||||
}
|
||||
|
||||
@ -202,11 +204,21 @@ class Companycontroller extends BaseController
|
||||
$ID = $this->request->getPost('ID');
|
||||
//$createdDate=$this->request->getPost('createdDate');
|
||||
|
||||
//$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber,'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO,'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'PaymentTerms'=>$Payment ,'PaymentDays'=>$PaymentDays ,'PayableAT'=>$PayableAT ,'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress,'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend);
|
||||
$Company = array('CompID' => $CompID, 'CompanyName' => $CompanyName, 'Address' => $Address, 'ContactNumber' => $ContactNumber, 'AlternateContactNumber' => $AlternateContactNumber, 'EmailAddress' => $EmailAddress, 'TIN' => $TIN, 'PAN' => $PAN, 'GSTNO' => $GSTNO, 'GSTRange' => $GSTRange, 'UANumber' => $UANumber, 'MSME' => $MSME , 'Createdby' => $createdby, 'ProfilePic' => $Picture, 'Exiseregistration' => $Exiseregistration, 'CollectrateAddress' => $CollectrateAddress, 'FiscalYearStartOn' => $financialstart, 'FiscalYearEndsOn' => $financialend, 'paymentID' => $PaymentId, 'companyWebsite' => $companywebsite, 'UpdatedBY' => $updatedby, 'Updatedon' => $updateddt);
|
||||
//$Company = array('CompID'=>$CompID,'CompanyName'=>$CompanyName,'Address'=>$Address,'ContactNumber'=>$ContactNumber,
|
||||
//'AlternateContactNumber'=>$AlternateContactNumber,'EmailAddress'=>$EmailAddress,'TIN'=>$TIN,'PAN'=>$PAN,'GSTNO'=>$GSTNO,
|
||||
//'GSTRange'=>$GSTRange,'UANumber'=>$UANumber,'PaymentTerms'=>$Payment ,'PaymentDays'=>$PaymentDays ,'PayableAT'=>$PayableAT ,
|
||||
//'Createdby'=>$createdby,'ProfilePic'=>$Picture,'Exiseregistration'=>$Exiseregistration,'CollectrateAddress'=>$CollectrateAddress,
|
||||
//'FiscalYearStartOn'=>$financialstart,'FiscalYearEndsOn'=> $financialend);
|
||||
$Company = array('CompID' => $CompID, 'CompanyName' => $CompanyName, 'Address' => $Address, 'ContactNumber' => $ContactNumber,
|
||||
'AlternateContactNumber' => $AlternateContactNumber, 'EmailAddress' => $EmailAddress, 'TIN' => $TIN, 'PAN' => $PAN,
|
||||
'GSTNO' => $GSTNO, 'GSTRange' => $GSTRange, 'UANumber' => $UANumber, 'MSME' => $MSME , 'Createdby' => $createdby,
|
||||
'ProfilePic' => $Picture, 'Exiseregistration' => $Exiseregistration, 'CollectrateAddress' => $CollectrateAddress,
|
||||
'FiscalYearStartOn' => $financialstart, 'FiscalYearEndsOn' => $financialend, 'paymentID' => $PaymentId,
|
||||
'companyWebsite' => $companywebsite, 'UpdatedBY' => $updatedby, 'Updatedon' => $updateddt);
|
||||
|
||||
if (!empty($file)) {
|
||||
$myfile = array('CompID' => $CompID, 'filename' => $file, 'ID' => $ID, 'filedescription' => $filedescription1, 'createdDate' => $createddt);
|
||||
if (!empty($file) && $file->getSize()){
|
||||
$fileName = $file->getName();
|
||||
$myfile = array('CompID' => $CompID, 'filename' => $fileName, 'uploadedby' => $ID, 'filedescription' => $filedescription1, 'createdDate' => $createddt);
|
||||
|
||||
$result2 = $this->companydetailsmodel->filedetails($myfile);
|
||||
}
|
||||
|
||||
@ -78,9 +78,9 @@ class Companydetails_model extends Model
|
||||
function companylisting()
|
||||
{
|
||||
$builder = $this->db->table('t_company_details com')
|
||||
->select('com.*,emp.firstname,pmt.PaymentTerms')
|
||||
->select('com.*,emp.firstname,pmt.PaymentTerms,tbl.userId')
|
||||
->join('t_paymentterms pmt', 'com.paymentID = pmt.PaymentID', 'left')
|
||||
->join('tbl_users as tbl', ' com.createdby = tbl.userid', 'left')
|
||||
->join('tbl_users as tbl', ' com.Createdby = tbl.userId', 'left')
|
||||
->join('t_employee_details as emp', 'emp.empid=tbl.empid', 'left');
|
||||
$query = $builder->get();
|
||||
$result = $query->getResult();
|
||||
|
||||
@ -59,6 +59,7 @@ if(!empty($userRecords))
|
||||
$PaymentTerms = $uf->PaymentTerms ;
|
||||
$PaymentId = $uf->paymentID;
|
||||
$MSME = $uf->MSME;
|
||||
$userId=$uf->userId;
|
||||
//$PaymentDays = $uf->PaymentDays ;
|
||||
//$PayableAT = $uf->PayableAT ;
|
||||
$Createdby = $uf->Createdby;
|
||||
@ -172,7 +173,8 @@ function readURL(input,num) {
|
||||
reader.readAsDataURL(input.files[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function isNumberKey(evt){
|
||||
@ -501,10 +503,25 @@ function ValidateUA() {
|
||||
<legend style="margin-left:-10px;color: #4f7c97;;color: #4f7c97;">Business Information</legend>
|
||||
<div class="col-md-12" style="margin-bottom: 27px;">
|
||||
<div class="form-row">
|
||||
|
||||
<input type="hidden" name="ID" class="form-control" readonly value="<?php echo $userId ?>">
|
||||
|
||||
|
||||
<?php if(empty($ProfilePic)){ ?>
|
||||
|
||||
<div class=" col-md-3">
|
||||
<img id="profilepicture" src="<?= base_url().'public/uploads/images/avatar.png'; ?>" alt="your image" style="width: 139px;"/><br/>
|
||||
<input type='file' input accept=".JPG,.PNG" onchange="readURL(this,0);" id="photo" value="<?php echo $ProfilePic ;?>" name="photo"/>
|
||||
<label for="photo">Select Company Logo<br/><small>(only .jpg or .png)</small></label>
|
||||
<img id="profilepicture" src="<?= base_url().'public/uploads/images/avatar.png' ?>" alt="your image" style="width: 139px;"/><br/>
|
||||
<br>
|
||||
<?php }else{ ?>
|
||||
<div class=" col-md-3">
|
||||
<img id="profilepicture" src="<?= base_url().'public/uploads/images/'. $ProfilePic ?>" alt="your image" style="width: 139px;"/><br/>
|
||||
<br>
|
||||
<?php } ?>
|
||||
|
||||
|
||||
<input type='file' class="mb-1" input accept=".JPG,.PNG" onchange="readURL(this,0);"
|
||||
id="photo" value="<?php base_url().'public/uploads/images/'. $ProfilePic; ?>" name="photo"/>
|
||||
<label for="photo">Select Company Logo<br/><small>(only .jpg or .png) </small> </label>
|
||||
<input type="hidden" name="Image" id="Image" value="<?php echo $ProfilePic ; ?>" class="form-control" readonly>
|
||||
<input type="hidden" name="ModifyImage" id="ModifyImage" class="form-control" readonly>
|
||||
</div>
|
||||
@ -514,7 +531,7 @@ function ValidateUA() {
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="col-form-label" for="CompanyName">CompanyName</label>
|
||||
<input type="text" name="CompanyName" onkeypress="return onlyAlphabets(event);" maxlength="100" id="CompanyName" class="form-control" required value="<?php echo $CompanyName;?>">
|
||||
<input type="text" name="CompanyName" onkeypress="return onlyAlphabets(event);" maxlength="100" id="CompanyName" class="form-control" required value="<?php echo $CompanyName;?>">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="col-form-label" for="ContactNumber">Contact Number<span class="badge">*</span></label>
|
||||
@ -709,17 +726,17 @@ function ValidateUA() {
|
||||
{
|
||||
foreach ($filetype as $rl)
|
||||
{
|
||||
?>
|
||||
?>
|
||||
<option value="<?php echo $rl->ConfigValue ?>"><?php echo $rl->ConfigValue ?></option>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<label style="margin-bottom:0px !important;" for="images">Select Company file<small> (only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
||||
<input style="margin-top: 5px;" type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG" onchange="readURL(this,1);" id="images" name="images"/>
|
||||
<label style="margin-bottom:0px !important;" for="files">Select file<small> (only .pdf,.excel,.doc,.png,.jpg)</small></label>
|
||||
<input style="margin-top: 5px;" type = "file" size = "20" input accept=".docx,.pdf,.doc.JPG,.PNG" onchange="readURL(this,1);" id="files" name="files"/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@ -791,7 +808,14 @@ function ValidateUA() {
|
||||
</div> <!-- content -->
|
||||
</div>
|
||||
|
||||
<script src="<?php echo base_url(); ?>public/assets/js/addUser.js" type="text/javascript"></script>
|
||||
<script src="<?php echo base_url(); ?>public/assets/js/addUser.js" type="text/javascript">
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
|
||||
function payment_hidden()
|
||||
@ -920,10 +944,18 @@ if ( $('#companywebsite').val().length < 1 )
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
|
||||
@ -951,10 +983,15 @@ if ( $('#companywebsite').val().length < 1 )
|
||||
<td style="width: 10%;" align="left" contenteditable="true"><%=IsActive%></td>
|
||||
</tr>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
var index = '1';
|
||||
$('.Add').click(function(){
|
||||
//alert("addonclick");
|
||||
$('#Add').click(function(){
|
||||
// alert("addonclick");
|
||||
var temp = index;
|
||||
var bankname = $('#BankName').val();
|
||||
var ifsccode = $('#IFSC').val();
|
||||
@ -997,7 +1034,18 @@ $('.Add').click(function(){
|
||||
|
||||
var template = jQuery("#addList").html();
|
||||
index = parseInt(index)+1;
|
||||
$('#databaseAppend').append(_.template(template,{index:temp,BankName:bankname,IFSC:ifsccode,BankAccountNumber:bankaccno,BankAddress:bankaddress,IsActive:isactive}));
|
||||
// $('#databaseAppend').append(_.(template,{index:temp,BankName:bankname,IFSC:ifsccode,BankAccountNumber:bankaccno,BankAddress:bankaddress,IsActive:isactive}));
|
||||
var html = `
|
||||
<tr>
|
||||
<td>${bankname}</td>
|
||||
<td>${ifsccode}</td>
|
||||
<td>${bankaccno}</td>
|
||||
<td>${bankaddress}</td>
|
||||
<td>${isactive}</td>
|
||||
</tr>
|
||||
`;
|
||||
$('#databaseAppend').append(html);
|
||||
|
||||
}//else closed
|
||||
}//if closed
|
||||
var tablevalue = $('#banktable').tableToJSON(); // Convert the table into a javascript object
|
||||
@ -1005,7 +1053,7 @@ $('.Add').click(function(){
|
||||
|
||||
//if(bankname != '' || ifsccode != '' || bankaddress != '' )
|
||||
//{
|
||||
$('#content').loader('show');
|
||||
// $('#content').loader('show');
|
||||
$.ajax({
|
||||
|
||||
data:{id:value},
|
||||
@ -1014,7 +1062,7 @@ $('.Add').click(function(){
|
||||
|
||||
success:function(data){
|
||||
|
||||
$('#content').loader('hide');
|
||||
// $('#content').loader('hide');
|
||||
alert(data);
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user