Inactive campaign related files
Showing
4 changed files
with
448 additions
and
290 deletions
| 1 | <?php | 1 | <?php |
| 2 | $client=Input::get("client"); | 2 | $client=Input::get("client"); |
| 3 | $status=Input::get("status"); | ||
| 4 | $campaignstartdate=Input::get("campaignstartdate"); | ||
| 5 | $campaignenddate=Input::get("campaignenddate"); | ||
| 6 | |||
| 3 | $monthworkdays=base64_encode(Input::get("monthworkdays")); | 7 | $monthworkdays=base64_encode(Input::get("monthworkdays")); |
| 4 | $agencyfeesvalue=base64_encode(Input::get("agencyfeesvalue")); | 8 | $agencyfeesvalue=base64_encode(Input::get("agencyfeesvalue")); |
| 5 | $agencyfeefunction=base64_encode(Input::get("agencyfeefunction")); | 9 | $agencyfeefunction=base64_encode(Input::get("agencyfeefunction")); |
| ... | @@ -73,9 +77,15 @@ $mvalue.="developerparam~$developerparam|"; | ... | @@ -73,9 +77,15 @@ $mvalue.="developerparam~$developerparam|"; |
| 73 | 77 | ||
| 74 | $mvalue.="trackerfields~$trackerfields|"; | 78 | $mvalue.="trackerfields~$trackerfields|"; |
| 75 | 79 | ||
| 76 | if($wakka->getCount("hrms_masters","mkey='$client' and mtype='company'")==0)$companyarr=$wakka->Query("insert into hrms_masters set mvalue='',mkey='$client',mtype='company';"); | 80 | //if($wakka->getCount("hrms_masters","mkey='$client' and mtype='company'")==0)$companyarr=$wakka->Query("insert into hrms_masters set mvalue='',mkey='$client',mtype='company';"); |
| 81 | //if($wakka->getCount("hrms_masters","mkey='$client' and mtype='company'")==0)$companyarr=$wakka->Query("insert into hrms_masters set mvalue='',mkey='$client',mtype='company', status='$status';"); | ||
| 82 | |||
| 83 | if($wakka->getCount("hrms_masters","mkey='$client' and mtype='company'")==0)$companyarr=$wakka->Query("insert into hrms_masters set mvalue='',mkey='$client',mtype='company', status='$status' ,campaignstartdate='$campaignstartdate', campaignenddate='$campaignenddate';"); | ||
| 84 | |||
| 85 | //$companyarr=$wakka->Query("update hrms_masters set mvalue='$mvalue' where mkey='$client' and mtype='company';"); | ||
| 86 | //$companyarr=$wakka->Query("update hrms_masters set mvalue='$mvalue', status='$status' where mkey='$client' and mtype='company';"); | ||
| 77 | 87 | ||
| 78 | $companyarr=$wakka->Query("update hrms_masters set mvalue='$mvalue' where mkey='$client' and mtype='company';"); | 88 | $companyarr=$wakka->Query("update hrms_masters set mvalue='$mvalue', status='$status', campaignstartdate='$campaignstartdate', campaignenddate='$campaignenddate' where mkey='$client' and mtype='company';"); |
| 79 | 89 | ||
| 80 | //if(!Auth::user()->moduleACL("Admin",true,true,true))$wakka->createMailQueue("system",$wakka->getEmailIdsFromList('HRManagerUsers'),Config::get("app.name").": Client Master Changed","[".$wakka->GetUserName()."] Has changed Clients [$client] Master Data"); | 90 | //if(!Auth::user()->moduleACL("Admin",true,true,true))$wakka->createMailQueue("system",$wakka->getEmailIdsFromList('HRManagerUsers'),Config::get("app.name").": Client Master Changed","[".$wakka->GetUserName()."] Has changed Clients [$client] Master Data"); |
| 81 | echo "<div class='message success close'><h2>Success!</h2><p>Data Saved</p></div>"; | 91 | echo "<div class='message success close'><h2>Success!</h2><p>Data Saved</p></div>"; | ... | ... |
| ... | @@ -4,10 +4,13 @@ if(Input::has('addcompany')) | ... | @@ -4,10 +4,13 @@ if(Input::has('addcompany')) |
| 4 | $company=trim(Input::get("addcompany")); | 4 | $company=trim(Input::get("addcompany")); |
| 5 | if($company!="") | 5 | if($company!="") |
| 6 | { | 6 | { |
| 7 | $companyarr=$wakka->LoadSingle("select * from hrms_masters where mtype='company' and mkey='$company'"); | 7 | //$companyarr=$wakka->LoadSingle("select * from hrms_masters where mtype='company' and mkey='$company'"); |
| 8 | $companyarr=$wakka->LoadSingle("select * from hrms_masters where mtype='company' and mkey='$company' and status='active'"); | ||
| 8 | if(!$companyarr) | 9 | if(!$companyarr) |
| 9 | { | 10 | { |
| 10 | $wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company';"); | 11 | //$wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company';"); |
| 12 | //$wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company',status='active';"); | ||
| 13 | $wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company',status='active', campaignstartdate='$campaignstartdate', campaignenddate='$campaignenddate';"); | ||
| 11 | } | 14 | } |
| 12 | } | 15 | } |
| 13 | 16 | ||
| ... | @@ -45,8 +48,18 @@ foreach($workflowarr as $wfline) | ... | @@ -45,8 +48,18 @@ foreach($workflowarr as $wfline) |
| 45 | if($client!="") | 48 | if($client!="") |
| 46 | { | 49 | { |
| 47 | $mastersdata=$wakka->getCompanyMaster($client); | 50 | $mastersdata=$wakka->getCompanyMaster($client); |
| 51 | $mastersdata["status"] = ucfirst($mastersdata["status"]); | ||
| 48 | 52 | ||
| 49 | echo "<br>"; | 53 | echo "<br>"; |
| 54 | echo "<p><label class='label-small_new' style='width:15%'>Status:</label><select class='form_hrm_select' name=status id=status> | ||
| 55 | <option value='".($mastersdata["status"])."'>".($mastersdata["status"])."</option> | ||
| 56 | <option value=active>Active</option> | ||
| 57 | <option value=inactive>Inactive</option> | ||
| 58 | </select></p>"; | ||
| 59 | |||
| 60 | echo "<p><label class='label-small_new' style='width:15%'>Campaign Start Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignstartdate id=campaignstartdate value='".($mastersdata["campaignstartdate"])."'></p>"; | ||
| 61 | echo "<p><label class='label-small_new' style='width:15%'>Campaign End Date :</label><input type=text class='form_new form_new_amend datetimepicker' name=campaignenddate id=campaignenddate value='".($mastersdata["campaignenddate"])."'></p>"; | ||
| 62 | |||
| 50 | echo "<p><label class='label-small_new' style='width:15%'>Contract Start Date :</label><input type=text class='form_new form_new_amend' name=contractstartdate id=contractstartdate value='".($mastersdata["contractstartdate"])."'></p>"; | 63 | echo "<p><label class='label-small_new' style='width:15%'>Contract Start Date :</label><input type=text class='form_new form_new_amend' name=contractstartdate id=contractstartdate value='".($mastersdata["contractstartdate"])."'></p>"; |
| 51 | echo "<p><label class='label-small_new' style='width:15%'>Contract End Date :</label><input type=text class='form_new form_new_amend' name=contractenddate id=contractenddate value='".($mastersdata["contractenddate"])."'></p>"; | 64 | echo "<p><label class='label-small_new' style='width:15%'>Contract End Date :</label><input type=text class='form_new form_new_amend' name=contractenddate id=contractenddate value='".($mastersdata["contractenddate"])."'></p>"; |
| 52 | 65 | ||
| ... | @@ -120,7 +133,9 @@ foreach($trackerfieldsarr as $key)$optionsstr.="<option value='$key' selected>$t | ... | @@ -120,7 +133,9 @@ foreach($trackerfieldsarr as $key)$optionsstr.="<option value='$key' selected>$t |
| 120 | foreach($toarr as $key=>$opts)$optionsstr.="<option value='$key'>$opts</option>"; | 133 | foreach($toarr as $key=>$opts)$optionsstr.="<option value='$key'>$opts</option>"; |
| 121 | ?> | 134 | ?> |
| 122 | <script> | 135 | <script> |
| 123 | 136 | $('body').on('focus',".datetimepicker", function(){ | |
| 137 | $(this).datetimepicker({format: 'HH:mm'}); | ||
| 138 | }); | ||
| 124 | $(document).ready(function(){ | 139 | $(document).ready(function(){ |
| 125 | 140 | ||
| 126 | }); | 141 | }); | ... | ... |
| 1 | <?php | 1 | <?php |
| 2 | // phpinfo(); | ||
| 3 | |||
| 4 | $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]); | 2 | $kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]); |
| 5 | 3 | ||
| 6 | //error_reporting(E_ALL); | 4 | //error_reporting(E_ALL); |
| 7 | ini_set("memory_limit", -1); | 5 | ini_set("memory_limit", -1); |
| 8 | 6 | ||
| 9 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); | 7 | include_once(app_path().'/lib/phpexcel/PHPExcel.php'); |
| 10 | include_once(app_path().'/lib/PHP_XLSXWriter-master/xlsxwriter.class.php'); | ||
| 11 | |||
| 12 | |||
| 13 | $wakka->setUserTimezone(); | 8 | $wakka->setUserTimezone(); |
| 14 | $themehome=$wakka->GetThemePath('/'); | 9 | $themehome=$wakka->GetThemePath('/'); |
| 15 | $sindex[0]='salbasic'; | 10 | $sindex[0]='salbasic'; |
| 16 | $sindex[1]='salhouserent'; | 11 | $sindex[1]='salhouserent'; |
| 17 | $sindex[2]='saltransport'; | 12 | $sindex[2]='saltransport'; |
| 18 | $sindex[3]='salfood'; | 13 | $sindex[3]='salfood'; |
| 19 | $sindex[4]='saltelephone'; | 14 | $sindex[4]='saltelephone'; |
| 20 | $sindex[5]='salmedical'; | 15 | $sindex[5]='salmedical'; |
| 21 | $sindex[6]='salelectricity'; | 16 | $sindex[6]='salelectricity'; |
| 22 | $sindex[7]='salother'; | 17 | $sindex[7]='salother'; |
| 23 | $sindex[8]='saltotal'; | 18 | $sindex[8]='saltotal'; |
| 24 | $sindex[9]='nettotal';$kformlib->HRFieldNames['nettotal']="Net Salary"; | 19 | $sindex[9]='nettotal';$kformlib->HRFieldNames['nettotal']="Net Salary"; |
| 25 | 20 | ||
| 26 | if(Input::has("reportsubmit")) | 21 | if(Input::has("reportsubmit")) |
| 27 | { | 22 | { |
| ... | @@ -31,177 +26,252 @@ if(Input::has("reportsubmit")) | ... | @@ -31,177 +26,252 @@ if(Input::has("reportsubmit")) |
| 31 | $rpt=Input::get("savedreportget"); | 26 | $rpt=Input::get("savedreportget"); |
| 32 | 27 | ||
| 33 | $userreports=$wakka->GetBBBUserData("UserSavedReports"); | 28 | $userreports=$wakka->GetBBBUserData("UserSavedReports"); |
| 34 | if(isset($userreports[$rpt])) | 29 | if(isset($userreports[$rpt])) |
| 35 | { | 30 | { |
| 36 | $tarr=json_decode(base64_decode($userreports[$rpt]),true); | 31 | $tarr=json_decode(base64_decode($userreports[$rpt]),true); |
| 37 | unset($tarr["_token"]); | 32 | unset($tarr["_token"]); |
| 38 | Input::merge($tarr); | 33 | Input::merge($tarr); |
| 39 | } | 34 | } |
| 40 | } | 35 | } |
| 41 | 36 | ||
| 42 | $empid=Input::get("empid"); | 37 | $empid=Input::get("empid"); |
| 43 | $client=Input::get("client"); | 38 | $client=Input::get("client"); |
| 44 | $currentstatus=Input::get("currentstatus"); | 39 | $currentstatus=Input::get("currentstatus"); |
| 45 | $modfrom=explode(".",Input::get("modfrom")); | 40 | $modfrom=explode(".",Input::get("modfrom")); |
| 46 | $modto=explode(".",Input::get("modto")); | 41 | $modto=explode(".",Input::get("modto")); |
| 47 | $crefrom=explode(".",Input::get("crefrom")); | 42 | $crefrom=explode(".",Input::get("crefrom")); |
| 48 | $creto=explode(".",Input::get("creto")); | 43 | $creto=explode(".",Input::get("creto")); |
| 49 | $reporttmpl=Input::get("reporttmpl"); | 44 | $reporttmpl=Input::get("reporttmpl"); |
| 50 | $visacompany=Input::get("visacompany"); | 45 | $visacompany=Input::get("visacompany"); |
| 51 | 46 | ||
| 52 | $asalmonth=Input::get("asalmonth"); | 47 | $asalmonth=Input::get("asalmonth"); |
| 53 | $asalyear=Input::get("asalyear"); | 48 | $asalyear=Input::get("asalyear"); |
| 54 | 49 | ||
| 55 | $frcrefrom=explode(".",Input::get("frcrefrom")); | 50 | $frcrefrom=explode(".",Input::get("frcrefrom")); |
| 56 | $frcreto=explode(".",Input::get("frcreto")); | 51 | $frcreto=explode(".",Input::get("frcreto")); |
| 57 | $fieldbyrange=trim(Input::get("fieldbyrange")); | 52 | $fieldbyrange=trim(Input::get("fieldbyrange")); |
| 58 | $filterbyfielddates=0; | 53 | $filterbyfielddates=0; |
| 59 | if($fieldbyrange!=""&&sizeof($frcrefrom)==3&&sizeof($frcreto)==3) | 54 | if($fieldbyrange!=""&&sizeof($frcrefrom)==3&&sizeof($frcreto)==3) |
| 60 | { | 55 | { |
| 61 | $filterbyfielddates=1; | 56 | $filterbyfielddates=1; |
| 62 | $frcrefrom=mktime(0, 0, 0, $frcrefrom[1], $frcrefrom[0], $frcrefrom[2]); | 57 | $frcrefrom=mktime(0, 0, 0, $frcrefrom[1], $frcrefrom[0], $frcrefrom[2]); |
| 63 | $frcreto=mktime(23, 59, 59, $frcreto[1], $frcreto[0], $frcreto[2]); | 58 | $frcreto=mktime(23, 59, 59, $frcreto[1], $frcreto[0], $frcreto[2]); |
| 64 | } | 59 | } |
| 65 | 60 | ||
| 66 | $ddprts=array(); | 61 | $ddprts=array(); |
| 67 | $datesdiffstr=Input::get("datesdiffstr"); | 62 | $datesdiffstr=Input::get("datesdiffstr"); |
| 68 | if(!empty($datesdiffstr)) | 63 | if(!empty($datesdiffstr)) |
| 69 | { | 64 | { |
| 70 | $ddprts=explode(",",$datesdiffstr);//datesdiffstr=servicestoppeddate,joiningdate,LT,180 ==> if(servicestopdate-joiningdate < 180) then ok,else not ok | 65 | $ddprts=explode(",",$datesdiffstr);//datesdiffstr=servicestoppeddate,joiningdate,LT,180 ==> if(servicestopdate-joiningdate < 180) then ok,else not ok |
| 71 | } | 66 | } |
| 72 | 67 | ||
| 73 | 68 | ||
| 74 | // $finputarr=Input::get("fieldsarr"); | 69 | //$finputarr=Input::get("fieldsarr"); |
| 75 | $finputarr=$_POST["fieldsarr"]; | 70 | $finputarr=$_REQUEST['fieldsarr']; |
| 76 | array_unshift($finputarr,'id'); | 71 | if(is_array($finputarr))foreach($finputarr as $eachfield)$fieldsarr[]=$eachfield; |
| 77 | 72 | else {echo "Please Select List of fields In report.";return;} | |
| 78 | $selectedfields=$_POST["selectedfields"]; | 73 | |
| 79 | array_unshift($selectedfields,'EmpID'); | 74 | $reporttype=Input::get("reporttype"); |
| 80 | 75 | $outputtype=Input::get("outputtype","XLS"); | |
| 81 | 76 | ||
| 82 | 77 | if(sizeof($fieldsarr)==0){echo "Please Select List of fields In report.";return;} | |
| 83 | if(is_array($finputarr))foreach($finputarr as $eachfield)$fieldsarr[]=$eachfield; | 78 | if($reporttype==""){echo "Please Select a Report Type.";return;} |
| 84 | else {echo "Please Select List of fields In report.";return;} | 79 | if($client==""&&$currentstatus==""&&$visacompany==''&&$modfrom[0]==''&&$crefrom[0]==''&&$empid==''&&$fieldbyrange==''){echo $client."Please Select atleast one of Client or Status or ModifyFrom or CreatedFrom.";return;} |
| 85 | 80 | ||
| 86 | $reporttype=Input::get("reporttype"); | 81 | if($reporttype=='Binary')$reporttype='|b'; |
| 87 | $outputtype=Input::get("outputtype","XLS"); | 82 | if($reporttype=='History')$reporttype='|h'; |
| 88 | 83 | if($reporttype=='Values')$reporttype=''; | |
| 89 | if(sizeof($fieldsarr)==0){echo "Please Select List of fields In report.";return;} | 84 | |
| 90 | if($client==""&&$currentstatus==""&&$visacompany==''&&$modfrom[0]==''&&$crefrom[0]==''&&$empid==''&&$fieldbyrange==''){echo $client."Please Select atleast one of Client or Status or ModifyFrom or CreatedFrom.";return;} | 85 | |
| 91 | 86 | $filterstr=array(); | |
| 92 | if($reporttype=='Binary')$reporttype='|b'; | 87 | |
| 93 | if($reporttype=='History')$reporttype='|h'; | 88 | if($empid!="") |
| 94 | if($reporttype=='Values')$reporttype=''; | 89 | { |
| 95 | 90 | $idarr=explode(',',$empid); | |
| 96 | 91 | foreach($idarr as $tid)if(trim($tid)!='')$tarr[]="'$tid'"; | |
| 97 | $filterstr=array(); | 92 | $empid=implode(",",$tarr); |
| 98 | 93 | ||
| 99 | if($empid!="") | 94 | $filterstr[]=" id in ($empid) "; |
| 100 | { | 95 | } |
| 101 | $idarr=explode(',',$empid); | 96 | else |
| 102 | foreach($idarr as $tid)if(trim($tid)!='')$tarr[]="'$tid'"; | 97 | { |
| 103 | $empid=implode(",",$tarr); | 98 | if($client!=""){$filterstr[]=getQueryFromList('client',$client);} |
| 104 | 99 | if($currentstatus!=""){$filterstr[]=getQueryFromList('currentstatus',$currentstatus);} | |
| 105 | $filterstr[]=" id in ($empid) "; | ||
| 106 | } | ||
| 107 | else | ||
| 108 | { | ||
| 109 | if($client!=""){$filterstr[]=getQueryFromList('client',$client);} | ||
| 110 | if($currentstatus!=""){$filterstr[]=getQueryFromList('currentstatus',$currentstatus);} | ||
| 111 | // if($visacompany!=""){$filterstr[]=getQueryFromList('visacompany',$visacompany);} | 100 | // if($visacompany!=""){$filterstr[]=getQueryFromList('visacompany',$visacompany);} |
| 112 | 101 | ||
| 113 | if($modfrom[0]!="")$filterstr[]=" modified>='$modfrom[2]-$modfrom[1]-$modfrom[0] 00:00:00' "; | 102 | if($modfrom[0]!="")$filterstr[]=" modified>='$modfrom[2]-$modfrom[1]-$modfrom[0] 00:00:00' "; |
| 114 | if($modto[0]!="") $filterstr[]=" modified<='$modto[2]-$modto[1]-$modto[0] 23:59:59' "; | 103 | if($modto[0]!="") $filterstr[]=" modified<='$modto[2]-$modto[1]-$modto[0] 23:59:59' "; |
| 115 | if($crefrom[0]!="")$filterstr[]=" created>='$crefrom[2]-$crefrom[1]-$crefrom[0] 00:00:00' "; | 104 | if($crefrom[0]!="")$filterstr[]=" created>='$crefrom[2]-$crefrom[1]-$crefrom[0] 00:00:00' "; |
| 116 | if($creto[0]!="") $filterstr[]=" created<='$creto[2]-$creto[1]-$creto[0] 23:59:59' "; | 105 | if($creto[0]!="") $filterstr[]=" created<='$creto[2]-$creto[1]-$creto[0] 23:59:59' "; |
| 106 | |||
| 107 | if($filterbyfielddates==1) | ||
| 108 | { | ||
| 109 | $filterstr[]=" modified>='".date('Y-m-d 00:00:00',$frcrefrom)."' "; | ||
| 110 | } | ||
| 111 | } | ||
| 112 | $type = PHPExcel_Cell_DataType::TYPE_STRING; | ||
| 113 | |||
| 114 | if(!empty($filterstr))$filterstr=implode(" and ",$filterstr);else $filterstr=""; | ||
| 115 | |||
| 116 | if($filterstr=="")$filterstr="1"; | ||
| 117 | |||
| 118 | $savereportname=Input::get("savereportname"); | ||
| 119 | if($savereportname!="") | ||
| 120 | { | ||
| 121 | $userreports=$wakka->GetBBBUserData("UserSavedReports"); | ||
| 122 | $userreports[$savereportname]=base64_encode(json_encode(Input::all())); | ||
| 123 | $wakka->SetBBBUserData("UserSavedReports",$userreports); | ||
| 124 | } | ||
| 125 | |||
| 126 | $usersarr=$wakka->getPersons($filterstr); | ||
| 117 | 127 | ||
| 118 | if($filterbyfielddates==1) | 128 | $inputFileType = "Excel5"; |
| 129 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); | ||
| 130 | $objPHPExcel = $objReader->load("$themehome/uploads/sreports/blank.xls"); | ||
| 131 | $baseRow = 3; | ||
| 132 | $highestColumn = sizeof($fieldsarr); | ||
| 133 | |||
| 134 | $baserowArr=$fieldsarr; | ||
| 135 | $objPHPExcel->getActiveSheet()->setCellValue("A1", "id"); | ||
| 136 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 137 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head+1); | ||
| 138 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."1", $baserowArr[$head]); | ||
| 139 | } | ||
| 140 | |||
| 141 | $objPHPExcel->getActiveSheet()->setCellValue("A2", "EMPID"); | ||
| 142 | for ($head = 0; $head < $highestColumn; $head++){ | ||
| 143 | $colstr=PHPExcel_Cell::stringFromColumnIndex($head+1); | ||
| 144 | $objPHPExcel->getActiveSheet()->setCellValue($colstr."2", $kformlib->HRFieldNames[$baserowArr[$head]]); | ||
| 145 | } | ||
| 146 | |||
| 147 | $skippedrows=0; | ||
| 148 | foreach($usersarr as $r => $userdata) | ||
| 149 | { | ||
| 150 | $ppldata=unserialize($userdata['peopledata']); | ||
| 151 | $logarr=unserialize($userdata['modifylog']); | ||
| 152 | |||
| 153 | |||
| 154 | $hrexclusiveflag=0;if(empty($ppldata['client']))$ppldata['client']='__'; | ||
| 155 | if(strstr($wakka->HRCoreVars['HRExclusiveClients'],$ppldata['client'])) | ||
| 156 | { | ||
| 157 | if(!$wakka->IsAdmin()) | ||
| 158 | { | ||
| 159 | if(!strstr($wakka->getManagerUsers($wakka->getUserListforClient($ppldata['client'])),$wakka->GetUserName())) | ||
| 160 | { | ||
| 161 | if(!strstr($wakka->GetBBBUserData("clientsownerlist"),$ppldata['client']))$hrexclusiveflag=1; | ||
| 162 | } | ||
| 163 | } | ||
| 164 | } | ||
| 165 | |||
| 166 | |||
| 167 | if(($wakka->GetBBBUserData("readotherdata")=="No"&&!$wakka->recordReadAccess($ppldata))||$hrexclusiveflag==1)$pass=0; | ||
| 168 | else | ||
| 169 | { | ||
| 170 | |||
| 171 | if($filterbyfielddates==1) | ||
| 172 | { | ||
| 173 | if(!isset($ppldata[$fieldbyrange])||trim($ppldata[$fieldbyrange])==""){$skippedrows++;continue;} | ||
| 174 | else | ||
| 175 | { | ||
| 176 | //$fieldbyrange $frcrefrom $frcreto | ||
| 177 | $tdt=explode(".",$ppldata[$fieldbyrange]); | ||
| 178 | if(sizeof($tdt)==3) | ||
| 119 | { | 179 | { |
| 120 | $filterstr[]=" modified>='".date('Y-m-d 00:00:00',$frcrefrom)."' "; | 180 | $tdt=mktime(0, 0, 0, intval($tdt[1]), intval($tdt[0]), intval($tdt[2])); |
| 181 | |||
| 182 | if(!($tdt>=$frcrefrom&&$tdt<=$frcreto)){$skippedrows++;continue;} | ||
| 121 | } | 183 | } |
| 122 | } | 184 | else {$skippedrows++;continue;} |
| 123 | $type = PHPExcel_Cell_DataType::TYPE_STRING; | 185 | } |
| 186 | } | ||
| 187 | if(sizeof($ddprts)>3) | ||
| 188 | { | ||
| 189 | $dddt1=explode(".",$ppldata[$ddprts[0]]); | ||
| 190 | $dddt2=explode(".",$ppldata[$ddprts[1]]); | ||
| 191 | $dddt1=mktime(0, 0, 0, intval($dddt1[1]), intval($dddt1[0]), intval($dddt1[2])); | ||
| 192 | $dddt2=mktime(0, 0, 0, intval($dddt2[1]), intval($dddt2[0]), intval($dddt2[2])); | ||
| 193 | |||
| 194 | if($ddprts[2]=="LT") | ||
| 195 | { | ||
| 196 | if($dddt1-$dddt2 < $ddprts[3]);else {$skippedrows++;continue;} | ||
| 197 | } | ||
| 198 | if($ddprts[2]=="GT") | ||
| 199 | { | ||
| 200 | if($dddt1-$dddt2 > $ddprts[3]);else {$skippedrows++;continue;} | ||
| 201 | } | ||
| 202 | } | ||
| 203 | |||
| 124 | 204 | ||
| 125 | if(!empty($filterstr))$filterstr=implode(" and ",$filterstr);else $filterstr=""; | 205 | $row = $baseRow + $r - $skippedrows;$rkey=0; |
| 126 | 206 | ||
| 127 | if($filterstr=="")$filterstr="1"; | 207 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(0,$row)->setValueExplicit($userdata['id'], $type); |
| 208 | foreach($baserowArr as $key => $val) | ||
| 209 | { | ||
| 210 | $cellval=$wakka->getXlsVal($baserowArr[$key].$reporttype,$ppldata,$logarr); | ||
| 211 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($key+1,$row)->setValueExplicit($cellval, $type); | ||
| 212 | $rkey=$key+1; | ||
| 213 | } | ||
| 214 | //month data in report | ||
| 215 | if($asalyear>2000&&$asalmonth>0) | ||
| 216 | { | ||
| 217 | $saldata=$ppldata["salaryentries"][$asalyear][$asalmonth]; | ||
| 218 | $leavedata=$ppldata["leavesentries"][$asalyear][1][$asalmonth]; | ||
| 128 | 219 | ||
| 129 | $savereportname=Input::get("savereportname"); | ||
| 130 | 220 | ||
| 131 | if($savereportname!="") | 221 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(++$rkey,$row)->setValueExplicit($leavedata[0][2], $type); |
| 132 | { | 222 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey,1)->setValueExplicit("Annual Leaves", $type); |
| 133 | $userreports=$wakka->GetBBBUserData("UserSavedReports"); | ||
| 134 | $userreports[$savereportname]=base64_encode(json_encode(Input::all())); | ||
| 135 | $wakka->SetBBBUserData("UserSavedReports",$userreports); | ||
| 136 | } | ||
| 137 | $usersarr=$wakka->getPersonsdownloadreport($filterstr); | ||
| 138 | 223 | ||
| 139 | foreach($usersarr as $r => $userdata) | 224 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(++$rkey,$row)->setValueExplicit($leavedata[1][2], $type); |
| 140 | { | 225 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey,1)->setValueExplicit("Sick Leaves", $type); |
| 141 | $ppldata[]=unserialize($userdata['peopledata']); | ||
| 142 | } | ||
| 143 | 226 | ||
| 144 | // dd($ppldata); | 227 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(++$rkey,$row)->setValueExplicit($leavedata[2][2], $type); |
| 145 | for ($i=0; $i <count($ppldata) ; $i++) { | 228 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey,1)->setValueExplicit("Meternity Leaves", $type); |
| 146 | 229 | ||
| 147 | for ($j=0; $j <count($finputarr) ; $j++) { | 230 | for($i=0;$i<=9;$i++) |
| 148 | if ($ppldata[$i] != false){ | 231 | { |
| 149 | 232 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+1,"1")->setValueExplicit($kformlib->HRFieldNames[$sindex[$i]], $type); | |
| 150 | if (array_key_exists ($finputarr[$j], $ppldata[$i])) { | 233 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+1,$row)->setValueExplicit($saldata[1][$i][1], $type); |
| 151 | |||
| 152 | $usersdata[$i][$finputarr[$j]]=$ppldata[$i][$finputarr[$j]]; | ||
| 153 | 234 | ||
| 154 | }else if (! array_key_exists ($finputarr[$j], $ppldata[$i])) | 235 | $rkey=$rkey+1; |
| 155 | { | ||
| 156 | $usersdata[$i][$finputarr[$j]] = ""; | ||
| 157 | |||
| 158 | } | ||
| 159 | } | 236 | } |
| 160 | } | 237 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(++$rkey,$row)->setValueExplicit($wakka->getLOPAmt($ppldata,$asalyear,$asalmonth), $type); |
| 161 | 238 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey,1)->setValueExplicit("LOP Amount", $type); | |
| 162 | } | ||
| 163 | 239 | ||
| 240 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow(++$rkey,$row)->setValueExplicit($wakka->getNWDAmt($ppldata,$asalyear,$asalmonth), $type); | ||
| 241 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey,1)->setValueExplicit("NWD Amount", $type); | ||
| 164 | 242 | ||
| 165 | $headerexcel = []; | 243 | foreach($saldata[0] as $tadded) |
| 166 | foreach($finputarr as $cachekey) | ||
| 167 | { | 244 | { |
| 168 | if($cachekey!='') | 245 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+1,1)->setValueExplicit("Add/Ded Type", $type); |
| 169 | { | 246 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+2,1)->setValueExplicit("Value", $type); |
| 170 | $headerexcel['id'] = 'string'; | 247 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+3,1)->setValueExplicit("Remarks", $type); |
| 171 | $headerexcel[$cachekey] = 'string'; //$headerexcel2[] = $cachekey => 'string'; | 248 | |
| 172 | } | 249 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+1,$row)->setValueExplicit($tadded[0], $type); |
| 173 | } | 250 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+2,$row)->setValueExplicit($tadded[1], $type); |
| 174 | // dd($headerexcel2); | 251 | $objPHPExcel->getActiveSheet()->getCellByColumnAndRow($rkey+3,$row)->setValueExplicit($tadded[2], $type); |
| 175 | $filename = "MainReport.xlsx"; | ||
| 176 | header('Content-disposition: attachment; filename="'.XLSXWriter::sanitize_filename($filename).'"'); | ||
| 177 | header("Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"); | ||
| 178 | header('Content-Transfer-Encoding: binary'); | ||
| 179 | header('Cache-Control: must-revalidate'); | ||
| 180 | header('Pragma: public'); | ||
| 181 | |||
| 182 | $writer = new XLSXWriter(); | ||
| 183 | $styles1 = array( 'font'=>'Arial','font-size'=>10,'font-style'=>'bold', 'fill'=>'#eee', 'halign'=>'center', 'border'=>'left,right,top,bottom'); | ||
| 184 | $writer->writeSheetHeader('Sheet1', $headerexcel,$styles1,['freeze_rows'=>1, 'freeze_columns'=>1]); | ||
| 185 | $writer->writeSheetRow('Sheet1', $selectedfields,$styles1 ); | ||
| 186 | |||
| 187 | foreach($usersdata as $row) | ||
| 188 | { | ||
| 189 | $writer->writeSheetRow('Sheet1', $row, $row_options = ['height'=>15]); | ||
| 190 | } | ||
| 191 | $writer->writeToStdOut(); | ||
| 192 | 252 | ||
| 193 | return; | 253 | $rkey+=3; |
| 254 | } | ||
| 255 | } | ||
| 256 | } | ||
| 257 | } | ||
| 194 | 258 | ||
| 259 | header('Content-Type: application/vnd.ms-excel'); | ||
| 260 | header('Content-Disposition: attachment;filename="MainReport.xls"'); | ||
| 261 | header('Cache-Control: max-age=0'); | ||
| 195 | 262 | ||
| 263 | $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, $inputFileType); | ||
| 264 | $objWriter->save('php://output'); | ||
| 265 | return; | ||
| 196 | } | 266 | } |
| 197 | function getQueryFromList($key,$list) | 267 | function getQueryFromList($key,$list) |
| 198 | { | 268 | { |
| 199 | $rstatusstr=array();$rstatuses=explode(",",$list); | 269 | $rstatusstr=array();$rstatuses=explode(",",$list); |
| 200 | foreach($rstatuses as $rstatus) | 270 | foreach($rstatuses as $rstatus) |
| 201 | { | 271 | { |
| 202 | if($rstatus!='')$rstatusstr[]="'$rstatus'"; | 272 | if($rstatus!='')$rstatusstr[]="'$rstatus'"; |
| 203 | } | 273 | } |
| 204 | return " ($key in (".implode(",",$rstatusstr).")) "; | 274 | return " ($key in (".implode(",",$rstatusstr).")) "; |
| 205 | } | 275 | } |
| 206 | ?> | 276 | ?> |
| 207 | <style> | 277 | <style> |
| ... | @@ -298,143 +368,201 @@ function getQueryFromList($key,$list) | ... | @@ -298,143 +368,201 @@ function getQueryFromList($key,$list) |
| 298 | </style> | 368 | </style> |
| 299 | 369 | ||
| 300 | <div class="layout-app"><!-- row-app --> | 370 | <div class="layout-app"><!-- row-app --> |
| 301 | <div class="row row-app"> | 371 | <div class="row row-app"> |
| 302 | <div class="col-md-12"> | 372 | |
| 303 | <div class="col-separator col-separator-first col-unscrollable box" style='overflow:hidden'> | 373 | <div class="col-md-12"> |
| 304 | <div class=innerAll> | 374 | |
| 305 | <div class="relativeWrap" > | 375 | <div class="col-separator col-separator-first col-unscrollable box" style='overflow:hidden'> |
| 306 | <div class="tab_generic"> | 376 | <div class=innerAll> |
| 307 | <div class="tab_bar_purple tabsbar-2"> | 377 | |
| 308 | <ul class="row row-merge"> | 378 | |
| 309 | <li class=active><a href="#tabs-1" data-toggle="tab">Select Filters and Report format</a></li> | 379 | |
| 310 | </ul> | 380 | <div class="relativeWrap" > |
| 311 | </div> | 381 | <div class="tab_generic"> |
| 312 | <div class="tab-content"> | 382 | |
| 313 | <div id=tabs-1 class="tab-pane active"> | 383 | <!-- Tabs Heading --> |
| 314 | <fieldset> | 384 | <div class="tab_bar_purple tabsbar-2"> |
| 315 | <legend class='task_legend'>Select Filters</legend> | 385 | <ul class="row row-merge"> |
| 316 | <form method=post action='hr?action=MainReport' target=_BLANK name=reportform> | 386 | <li class=active><a href="#tabs-1" data-toggle="tab">Select Filters and Report format</a></li> |
| 317 | <input type=hidden name=_token value='<?php echo csrf_token(); ?>'> | 387 | </ul> |
| 318 | <input type=hidden name=client id=client value=''> | 388 | </div> |
| 319 | <input type=hidden name=visacompany id=visacompany value=''> | 389 | <!-- // Tabs Heading END --> |
| 320 | <input type=hidden name=currentstatus id=currentstatus value=''> | 390 | |
| 321 | <div id=reportformarrs></div> | 391 | <div class="tab-content"> |
| 322 | <p> | 392 | |
| 323 | <label class='label-small_new' style='width:15%'>Record Ids:</label> | 393 | <div id=tabs-1 class="tab-pane active"> |
| 324 | <input class='form_new form_new_amend' id='empid' name='empid' type='text' value='' style='width:25%' /> | 394 | <fieldset> |
| 325 | <span class=field_desc id='fd'></span><span class=validate_success></span><span class=validate_error></span> | 395 | <legend class='task_legend'>Select Filters</legend> |
| 326 | </p> | 396 | <form method=post action='hr?action=MainReport' target=_BLANK name=reportform> |
| 327 | <p><label class='label-small_new' style='width:15%'></label><b>-- OR --</b></p> | 397 | <input type=hidden name=_token value='<?php echo csrf_token(); ?>'> |
| 328 | <p> | 398 | <input type=hidden name=client id=client value=''> |
| 329 | <label class='label-small_new' style='width:15%'>Company: </label> | 399 | <input type=hidden name=visacompany id=visacompany value=''> |
| 330 | <select name=client2 id=client2 multiple='' data-rel=chosen class=select2multi style='width:40%'> | 400 | <input type=hidden name=currentstatus id=currentstatus value=''> |
| 331 | <?php | 401 | <div id=reportformarrs></div> |
| 332 | $clients=$wakka->clientsReadAccess(); | 402 | |
| 333 | sort($clients); | 403 | <p> |
| 334 | foreach($clients as $clientval){echo "<option value='$clientval'>$clientval</option>";} | 404 | <label class='label-small_new' style='width:15%'>Record Ids:</label> |
| 335 | ?> | 405 | <input class='form_new form_new_amend' id='empid' name='empid' type='text' value='' style='width:25%' /> |
| 336 | </select> | 406 | <span class=field_desc id='fd'></span><span class=validate_success></span><span class=validate_error></span> |
| 337 | </p> | 407 | </p> |
| 338 | <div class='clear:both'></div> | 408 | <p> |
| 339 | <!--<p> | 409 | <label class='label-small_new' style='width:15%'></label> |
| 340 | <label class='label-small_new' style='width:15%'>Visa Company: </label> | 410 | <b>-- OR --</b> |
| 341 | <select name=visacompany2 id=visacompany2 multiple='' data-rel=chosen class=select2multi style='width:40%'> | 411 | </p> |
| 342 | <?php | 412 | <p> |
| 343 | $clients=explode("~",$kformlib->FormSelectVals['visacompany']); | 413 | <label class='label-small_new' style='width:15%'>Company: </label> |
| 344 | foreach($clients as $clientval){echo "<option value='$clientval'>$clientval</option>";} | 414 | <select name=client2 id=client2 multiple='' data-rel=chosen class=select2multi style='width:40%'> |
| 345 | ?> | 415 | <?php |
| 346 | </select> | 416 | $clients=$wakka->clientsReadAccess(); |
| 347 | </p>--> | 417 | sort($clients); |
| 348 | 418 | foreach($clients as $clientval){echo "<option value='$clientval'>$clientval</option>";} | |
| 349 | <?php | 419 | ?> |
| 350 | $toarr=array(); | 420 | </select> |
| 351 | $optionsstr=""; | 421 | </p> |
| 352 | $fileids=explode(",",$kformlib->HRFiledsStr); | 422 | <div class='clear:both'></div> |
| 353 | foreach($fileids as $fileid) | 423 | <!-- <p> |
| 354 | { | 424 | <label class='label-small_new' style='width:15%'>Visa Company: </label> |
| 355 | if(trim($fileid)!='') | 425 | <select name=visacompany2 id=visacompany2 multiple='' data-rel=chosen class=select2multi style='width:40%'> |
| 356 | { | 426 | <?php |
| 357 | if(strstr($kformlib->HRFileFieldsStr,$fileid))$ftype='File'; | 427 | $clients=explode("~",$kformlib->FormSelectVals['visacompany']); |
| 358 | else if(strstr($kformlib->HRDateFilds,$fileid))$ftype='Date'; | 428 | foreach($clients as $clientval){echo "<option value='$clientval'>$clientval</option>";} |
| 359 | else if(strstr($kformlib->HRDropFilds,$fileid))$ftype='Dropdown'; | 429 | ?> |
| 360 | else $ftype='Text'; | 430 | </select> |
| 361 | $toarr[$fileid]=$kformlib->HRFieldNames[$fileid]; | 431 | </p>--> |
| 362 | } | 432 | <p> |
| 363 | } | 433 | <label class='label-small_new' style='width:15%'>Record Status: </label> |
| 434 | <select name=currentstatus2 id=currentstatus2 multiple='' data-rel=chosen class=select2multi style='width:40%'> | ||
| 435 | <?php | ||
| 436 | $clients=explode("~",$kformlib->FormSelectVals['currentstatus']); | ||
| 437 | foreach($clients as $clientval){echo "<option value='$clientval'>$clientval</option>";} | ||
| 438 | ?> | ||
| 439 | <?php if($wakka->IsAdmin()){ ?><option value='<?php echo $wakka->HRCoreVars["systemExitStatus"]; ?>'><?php echo $wakka->HRCoreVars["systemExitStatus"]; ?></option><?php } ?> | ||
| 440 | </select> | ||
| 441 | </p> | ||
| 442 | <p> | ||
| 443 | <label class='label-small_new' style='width:15%'>Record Modified From: </label> | ||
| 444 | <input size=7 id='modfrom' name='modfrom' type='text' value='' /> To: <input size=7 id='modto' name='modto' type='text' value='' /> | ||
| 445 | </p> | ||
| 446 | <p> | ||
| 447 | <label class='label-small_new' style='width:15%'>Record Created From: </label> | ||
| 448 | <input size=7 id='crefrom' name='crefrom' type='text' value='' /> To: <input size=7 id='creto' name='creto' type='text' value='' /> | ||
| 449 | </p> | ||
| 450 | <p> | ||
| 451 | <label class='label-small_new' style='width:15%'>For:</label><select class='form_hrm_select' id=fieldbyrange name=fieldbyrange><option></option> | ||
| 452 | <?php | ||
| 453 | $dtfields=explode(",",$kformlib->HRDateFilds); | ||
| 454 | foreach($dtfields as $tdtf)if(trim($tdtf)!="")echo "<option value='$tdtf'>".$kformlib->HRFieldNames[$tdtf]."</option>"; | ||
| 455 | ?> | ||
| 456 | </select> | ||
| 457 | </p> | ||
| 458 | |||
| 459 | <p> | ||
| 460 | <label class='label-small_new' style='width:15%'>Between:</label> | ||
| 461 | <input size=7 id='frcrefrom' name='frcrefrom' type='text' value='' /> To: <input size=7 id='frcreto' name='frcreto' type='text' value='' /> | ||
| 462 | </p> | ||
| 463 | |||
| 464 | <?php | ||
| 465 | $toarr=array(); | ||
| 466 | $optionsstr=""; | ||
| 467 | $fileids=explode(",",$kformlib->HRFiledsStr); | ||
| 468 | foreach($fileids as $fileid) | ||
| 469 | { | ||
| 470 | if(trim($fileid)!='') | ||
| 471 | { | ||
| 472 | if(strstr($kformlib->HRFileFieldsStr,$fileid))$ftype='File'; | ||
| 473 | else if(strstr($kformlib->HRDateFilds,$fileid))$ftype='Date'; | ||
| 474 | else if(strstr($kformlib->HRDropFilds,$fileid))$ftype='Dropdown'; | ||
| 475 | else $ftype='Text'; | ||
| 476 | $toarr[$fileid]=$kformlib->HRFieldNames[$fileid]." ($ftype)"; | ||
| 477 | } | ||
| 478 | } | ||
| 364 | //asort($toarr); | 479 | //asort($toarr); |
| 365 | foreach($toarr as $key=>$opts)$optionsstr.="<option value='$key'>$opts</option>"; | 480 | foreach($toarr as $key=>$opts)$optionsstr.="<option value='$key'>$opts</option>"; |
| 366 | ?> | 481 | ?> |
| 367 | 482 | ||
| 368 | <p><label class='label-small_new' style='width:15%;'>Fields: </label> | 483 | <p><label class='label-small_new' style='width:15%;'>Fields: </label> |
| 369 | <select size=9 id=fieldsarr2 multiple='multiple' style='width:40%' class=select2multi> | 484 | <select size=9 id=fieldsarr2 multiple='multiple' style='width:40%' class=select2multi><?php echo $optionsstr; ?></select><span style='margin-left: 20px;line-height: 30px;'>(Hold ctrl to select multiple)</span></p> |
| 370 | <?php echo $optionsstr; ?> | 485 | <p><label class='label-small_new' style='width:15%'>Report Type</label><select class='form_hrm_select' id=reporttype name=reporttype><option value='Values'>Values</option><option value='Binary'>Binary</option><option value='History'>History</option></select> |
| 371 | </select> | 486 | <select class='form_hrm_select' id=outputtype name=outputtype><option value='XLS'>XLS</option><option value='CSV'>CSV</option></select> |
| 372 | <span style='margin-left: 20px;line-height: 30px;'>(Hold ctrl to select multiple)</span> | 487 | <select class='form_hrm_select' id='asalmonth' name='asalmonth'> |
| 373 | </p> | 488 | <option value=''></option> |
| 374 | <p><label class='label-small_new' style='width:15%'>Report Type</label> | 489 | <option value=1>Jan</option> |
| 375 | <select class='form_hrm_select' id=outputtype name=outputtype><option value='XLSX'>XLSX</option><!-- <option value='CSV'>CSV</option></select> --> | 490 | <option value=2>Feb</option> |
| 376 | </p> | 491 | <option value=3>Mar</option> |
| 377 | 492 | <option value=4>Apr</option> | |
| 378 | <p> | 493 | <option value=5>May</option> |
| 379 | <label class='label-small_new' style='width:15%'></label> | 494 | <option value=6>Jun</option> |
| 380 | <input type=hidden name=reportsubmit value=reportsubmit> | 495 | <option value=7>Jul</option> |
| 381 | <input class='form_new form_new_amend' style='width:355px' type=text name=savereportname id=savereportname placeholder='Name of the report to save'> | 496 | <option value=8>Aug</option> |
| 382 | <input type=button class='btn btn-purple_outline' name=reportsubmit value="Generate Report" onclick="setRptSelection();return false;"> | 497 | <option value=9>Sep</option> |
| 383 | <span class=field_desc id='fd'></span><span class=validate_success></span><span class=validate_error></span> | 498 | <option value=10>Oct</option> |
| 384 | </p> | 499 | <option value=11>Nov</option> |
| 385 | </form> | 500 | <option value=12>Dec</option> |
| 386 | </fieldset> | 501 | </select> |
| 387 | 502 | <select class='form_hrm_select' id='asalyear' name='asalyear'> | |
| 388 | 503 | <option value=''></option> | |
| 389 | <fieldset id='saved_reprts'><legend class='new-recruit_legend'>Saved Reports</legend> | 504 | <?php for($i=date('Y')+1;$i>=1990;$i--)echo "<option value=$i>$i</option>"; ?> |
| 390 | <?php | 505 | </select> |
| 391 | $savedreports=$wakka->GetBBBUserData("UserSavedReports"); | 506 | |
| 392 | if(is_array($savedreports))foreach($savedreports as $rname=>$rpts) | 507 | </p> |
| 393 | { | 508 | |
| 394 | echo "<p><label class='label-small_new' style='width:15%'>$rname</label><a href='".url("/hr/MainReport?reportsubmit=1&savedreportget=$rname")."' class='btn btn-purple' target=_BLANK>Download</a> <a href=# title='Delete this entry' onclick='deletesavedreport(\"$rname\");return false;' style='margin-left: 50px;'><i class='fa fa-times-circle' style='color:#967bdc'>Delete</i></a></p>"; | 509 | <p> |
| 395 | } | 510 | <label class='label-small_new' style='width:15%'></label> |
| 396 | ?> | 511 | <input type=hidden name=reportsubmit value=reportsubmit> |
| 397 | 512 | <input class='form_new form_new_amend' style='width:355px' type=text name=savereportname id=savereportname placeholder='Name of the report to save'> | |
| 398 | </fieldset> | 513 | <input type=button class='btn btn-purple_outline' name=reportsubmit value="Generate Report" onclick="setRptSelection();return false;"> |
| 399 | </div> | 514 | <span class=field_desc id='fd'></span><span class=validate_success></span><span class=validate_error></span> |
| 400 | </div> | 515 | </p> |
| 401 | 516 | </form> | |
| 402 | </div> | 517 | </fieldset> |
| 403 | </div> | 518 | |
| 404 | </div> | 519 | |
| 405 | <!-- // Tabs END --> | 520 | <fieldset id='saved_reprts'><legend class='new-recruit_legend'>Saved Reports</legend> |
| 406 | 521 | <?php | |
| 407 | 522 | $savedreports=$wakka->GetBBBUserData("UserSavedReports"); | |
| 408 | 523 | if(is_array($savedreports))foreach($savedreports as $rname=>$rpts) | |
| 409 | </div> | 524 | { |
| 525 | echo "<p><label class='label-small_new' style='width:15%'>$rname</label><a href='".url("/hr/MainReport?reportsubmit=1&savedreportget=$rname")."' class='btn btn-purple' target=_BLANK>Download</a> <a href=# title='Delete this entry' onclick='deletesavedreport(\"$rname\");return false;' style='margin-left: 50px;'><i class='fa fa-times-circle' style='color:#967bdc'>Delete</i></a></p>"; | ||
| 526 | } | ||
| 527 | ?> | ||
| 528 | |||
| 529 | </fieldset> | ||
| 530 | </div> | ||
| 531 | </div> | ||
| 532 | |||
| 410 | </div> | 533 | </div> |
| 411 | </div> | 534 | </div> |
| 412 | |||
| 413 | </div> | 535 | </div> |
| 536 | <!-- // Tabs END --> | ||
| 537 | |||
| 538 | |||
| 539 | |||
| 540 | </div> | ||
| 541 | </div> | ||
| 542 | </div> | ||
| 543 | |||
| 544 | </div> | ||
| 414 | </div><!-- // END row-app --> | 545 | </div><!-- // END row-app --> |
| 415 | 546 | ||
| 416 | <script> | 547 | <script> |
| 417 | $('#modfrom').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | 548 | $('#modfrom').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); |
| 418 | $('#modto').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | 549 | $('#modto').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); |
| 419 | $('#crefrom').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | 550 | $('#crefrom').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); |
| 420 | $('#creto').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | 551 | $('#creto').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); |
| 421 | 552 | ||
| 422 | $('#frcrefrom').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | 553 | $('#frcrefrom').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); |
| 423 | $('#frcreto').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); | 554 | $('#frcreto').datepicker({dateFormat: 'dd.mm.yy',inline: true,changeYear: true,selectOtherMonths: true,yearRange: '<?php echo (date('Y')-70).":".(date('Y')+5); ?>'}); |
| 424 | 555 | ||
| 425 | function setRptSelection() | 556 | function setRptSelection() |
| 426 | { | 557 | { |
| 427 | $("#client").val($("#client2").val()); | 558 | $("#client").val($("#client2").val()); |
| 428 | // $("#visacompany").val($("#visacompany2").val()); | 559 | // $("#visacompany").val($("#visacompany2").val()); |
| 429 | $("#currentstatus").val($("#currentstatus2").val()); | 560 | $("#currentstatus").val($("#currentstatus2").val()); |
| 430 | 561 | ||
| 431 | $("#reportformarrs").html(""); | 562 | $("#reportformarrs").html(""); |
| 432 | $("#fieldsarr2").select2("data").forEach(function(elem){$("#reportformarrs").append("<input type=hidden name=fieldsarr[] value='"+elem.id+"'>");}); | 563 | $("#fieldsarr2").select2("data").forEach(function(elem){$("#reportformarrs").append("<input type=hidden name=fieldsarr[] value='"+elem.id+"'>");}); |
| 433 | 564 | ||
| 434 | $("#fieldsarr2").select2("data").forEach(function(elem){$("#reportformarrs").append("<input type=hidden name=selectedfields[] value='"+elem.text+"'>");}); | 565 | document.reportform.submit(); |
| 435 | |||
| 436 | |||
| 437 | document.reportform.submit(); | ||
| 438 | } | 566 | } |
| 439 | // $("#client2").dropdownchecklist({icon:{}, width:300, maxDropHeight:300, emptyText:"Select.." }); | 567 | // $("#client2").dropdownchecklist({icon:{}, width:300, maxDropHeight:300, emptyText:"Select.." }); |
| 440 | // $("#visacompany2").dropdownchecklist({icon:{}, width:300, maxDropHeight:300, emptyText:"Select.." }); | 568 | // $("#visacompany2").dropdownchecklist({icon:{}, width:300, maxDropHeight:300, emptyText:"Select.." }); |
| ... | @@ -442,6 +570,6 @@ document.reportform.submit(); | ... | @@ -442,6 +570,6 @@ document.reportform.submit(); |
| 442 | 570 | ||
| 443 | function deletesavedreport(rname) | 571 | function deletesavedreport(rname) |
| 444 | { | 572 | { |
| 445 | doAjax('hr?action=DeleteSavedReport&rname='+rname,'','searchresults'); | 573 | doAjax('hr?action=DeleteSavedReport&rname='+rname,'','searchresults'); |
| 446 | } | 574 | } |
| 447 | </script> | 575 | </script> | ... | ... |
| ... | @@ -198,12 +198,14 @@ $reportarr=$wakka->LoadAll("select * from hrms_masters where mtype='reports' ord | ... | @@ -198,12 +198,14 @@ $reportarr=$wakka->LoadAll("select * from hrms_masters where mtype='reports' ord |
| 198 | if($user["role"]=="Manager"||$wakka->IsAdmin()) | 198 | if($user["role"]=="Manager"||$wakka->IsAdmin()) |
| 199 | { | 199 | { |
| 200 | $companyarr=$wakka->LoadAll("select * from hrms_masters where mtype='company'"); | 200 | $companyarr=$wakka->LoadAll("select * from hrms_masters where mtype='company'"); |
| 201 | // print_r($companyarr); | ||
| 201 | foreach($companyarr as $tcompany)echo "<option value='$tcompany[mkey]'>$tcompany[mkey]</option>"; | 202 | foreach($companyarr as $tcompany)echo "<option value='$tcompany[mkey]'>$tcompany[mkey]</option>"; |
| 202 | } | 203 | } |
| 203 | else | 204 | else |
| 204 | { | 205 | { |
| 205 | echo "<option value=''></option>"; | 206 | echo "<option value=''></option>"; |
| 206 | $clients=explode(",",trim($wakka->GetBBBUserData("clientsownerlist"))); | 207 | $clients=explode(",",trim($wakka->GetBBBUserData("clientsownerlist"))); |
| 208 | // print_r($clients); | ||
| 207 | foreach($clients as $tclient)if(trim($tclient)!="")echo "<option value='$tclient'>$tclient</option>"; | 209 | foreach($clients as $tclient)if(trim($tclient)!="")echo "<option value='$tclient'>$tclient</option>"; |
| 208 | } | 210 | } |
| 209 | ?> | 211 | ?> |
| ... | @@ -426,6 +428,9 @@ function saveCompanies() | ... | @@ -426,6 +428,9 @@ function saveCompanies() |
| 426 | { | 428 | { |
| 427 | var vardata="client="+$("#companyselect").val(); | 429 | var vardata="client="+$("#companyselect").val(); |
| 428 | 430 | ||
| 431 | vardata+="&status="+encodeURIComponent($("#status").val()); | ||
| 432 | vardata+="&campaignstartdate="+encodeURIComponent($("#campaignstartdate").val()); | ||
| 433 | vardata+="&campaignenddate="+encodeURIComponent($("#campaignenddate").val()); | ||
| 429 | vardata+="&agencyfeesvalue="+encodeURIComponent($("#agencyfeesvalue").val()); | 434 | vardata+="&agencyfeesvalue="+encodeURIComponent($("#agencyfeesvalue").val()); |
| 430 | vardata+="&agencyfeefunction="+encodeURIComponent($("#agencyfeefunction").val()); | 435 | vardata+="&agencyfeefunction="+encodeURIComponent($("#agencyfeefunction").val()); |
| 431 | vardata+="&contractstartdate="+encodeURIComponent($("#contractstartdate").val()); | 436 | vardata+="&contractstartdate="+encodeURIComponent($("#contractstartdate").val()); | ... | ... |
-
Please register or sign in to post a comment