loadcompanymaster.blade.php
8.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?php
if(Input::has('addcompany'))
{
$company=trim(Input::get("addcompany"));
if($company!="")
{
//$companyarr=$wakka->LoadSingle("select * from hrms_masters where mtype='company' and mkey='$company'");
$companyarr=$wakka->LoadSingle("select * from hrms_masters where mtype='company' and mkey='$company' and status='active'");
if(!$companyarr)
{
//$wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company';");
//$wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company',status='active';");
$wakka->Query("insert into hrms_masters set mvalue='',mkey='$company',mtype='company',status='active', campaignstartdate='$campaignstartdate', campaignenddate='$campaignenddate';");
/*if(!(Schema::hasTable('records_'.$company)))
{
DB::statement("CREATE TABLE records_$company LIKE records;");
DB::insert(DB::raw("Insert into records_$company SELECT * from records where client='$company'"));
//exit();
}*/
}
}
return;
}
$kformlib=new \App\Jobs\KFormLib($wakka->HRCoreVars["HRFiledsStr"]);
$client=Input::get("client");
$snedmailsarr=array();
$workflowarr=$wakka->LoadAll("select * from hrms_masters where mtype='workflow';");
foreach($workflowarr as $wfline)
{
$workflow=explode("~~~",$wfline['mvalue']);
$controls=explode("|",$workflow[0]);
$tasks=explode("_EOF_",$workflow[1]);//$tasks=explode("\n",$workflow[1]);
foreach($tasks as $task)
{
if(trim($task)!='')
{
$taskVals=explode("|",$task);$taskVals[0]=trim($taskVals[0]);
if($taskVals[0]=="{{clientcontact}}")
{
$snedmailsarr[]=$controls[0];
}
}
}
}
if($client!="")
{
$mastersdata=$wakka->getCompanyMaster($client);
$mastersdata["status"] = ucfirst($mastersdata["status"]);
echo "<br>";
echo "<p><label class='label-small_new' style='width:15%'>Status:</label><select class='form_hrm_select' name=status id=status>
<option value='".($mastersdata["status"])."'>".($mastersdata["status"])."</option>
<option value=active>Active</option>
<option value=inactive>Inactive</option>
</select></p>";
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>";
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>";
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>";
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>";
echo "<p><label class='label-small_new' style='width:15%'>Serviced By :</label><input type=text class='form_new form_new_amend' name=servicedby id=servicedby value='".($mastersdata["servicedby"])."'></p>";
echo "<p><label class='label-small_new' style='width:15%'>Insurance Required:</label><select class='form_hrm_select' name=insurancerequired id=insurancerequired>
<option value='".($mastersdata["insurancerequired"])."'>".($mastersdata["insurancerequired"])."</option>
<option value=Yes>Yes</option>
<option value=No>No</option>
</select></p>";
echo "<fieldset style='float:left;width:45%;margin-right:3px;' id='hr_cntct'><legend class='new-recruit_legend'>HR Contact</legend><p><label class='label-small_new' style='width:25%'>Person :</label><input type=text class='form_new form_new_amend' name=contactname id=contactname value='".($mastersdata["contactname"])."'></p>";
echo "<p><label class='label-small_new' style='width:25%'>Phone :</label><input type=text class='form_new form_new_amend' name=contactphone id=contactphone value='".($mastersdata["contactphone"])."'></p>";
echo "<p><label class='label-small_new' style='width:25%'>Email :</label><input type=text class='form_new form_new_amend' name=contactemail id=contactemail value='".($mastersdata["contactemail"])."'></p>
<p><label class='label-small_new' style='width:25%'>Send Files</label><select id=hrsendfiles name=hrsendfiles multiple='multiple' size=5>";
$toarr=array();
$optionsstr="";
foreach($snedmailsarr as $fileid)
{
if(trim($fileid)!='')$toarr[$fileid]=$kformlib->HRFieldNames[$fileid];
}
$toarr['weeklyexpiringdocs']="Weekly Expiring Docs";
asort($toarr);
foreach($toarr as $key=>$opts)
{
$selstr="";if(strstr($mastersdata["hrsendfiles"],$key))$selstr="selected=selected";
$optionsstr.="<option value='$key' $selstr>$opts</option>";
}
echo "$optionsstr</select></p></fieldset>";
echo "<fieldset style='float:left;width:45%' id='acc_cntct'><legend class='new-recruit_legend'>Accounts Contact</legend><p><label class='label-small_new' style='width:25%'>Person :</label><input type=text class='form_new form_new_amend' name=contactnameacct id=contactnameacct value='".($mastersdata["contactnameacct"])."'></p>";
echo "<p><label class='label-small_new' style='width:25%'>Phone :</label><input type=text class='form_new form_new_amend' name=contactphoneacct id=contactphoneacct value='".($mastersdata["contactphoneacct"])."'></p>";
echo "<p><label class='label-small_new' style='width:25%'>Email :</label><input type=text class='form_new form_new_amend' name=contactemailacct id=contactemailacct value='".($mastersdata["contactemailacct"])."'></p>
<p><label class='label-small_new' style='width:25%'></label> </p></fieldset><div style='clear:both'></div>";
echo "<p><label class='label-small_new' style='width:15%'>Working Days in Month :</label><input type=text class='form_new form_new_amend' name=monthworkdays id=monthworkdays value='".($mastersdata["monthworkdays"])."'> eg M or 30 or 31</p>";
echo "<p><label class='label-small_new' style='width:15%'>AgencyFee/Emp/Month :</label><input type=text class='form_new form_new_amend' name=agencyfeesvalue id=agencyfeesvalue value='".($mastersdata["agencyfeesvalue"])."' style='width:15%'>
<select class=form_hrm_select style='width:15%' name=agencyfeefunction id=agencyfeefunction><option value='$mastersdata[agencyfeefunction]'>$mastersdata[agencyfeefunction]</option>
<option value=''></option><option value='X Gross'>X Gross</option><option value='X CTCIndia'>X CTCIndia</option></select></p>";
echo "<p><label class='label-small_new' style='width:15%'>AnnualLeaves :</label><input type=text class='form_new form_new_amend' name=yrannualleaves id=yrannualleaves value='".($mastersdata["yrannualleaves"])."'></p>";
echo "<p><label class='label-small_new' style='width:15%'>SickLeaves :</label><input type=text class='form_new form_new_amend' name=yrsickleaves id=yrsickleaves value='".($mastersdata["yrsickleaves"])."'></p>";
echo "<p><label class='label-small_new' style='width:15%'>MeternityLeaves :</label><input type=text class='form_new form_new_amend' name=yrmeternityleaves id=yrmeternityleaves value='".($mastersdata["yrmeternityleaves"])."'></p>";
echo "<p><label class='label-small_new' style='width:15%'>AnnualMaxCarryLeaves :</label><input type=text class='form_new form_new_amend' name=yemaxcarryleaves id=yemaxcarryleaves value='".($mastersdata["yemaxcarryleaves"])."'></p>";
echo "<p><label class='label-small_new' style='width:15%'>Parameters</label><textarea rows=8 id='developerparam' style='font-size:12px;width:85%'>".($mastersdata["developerparam"])."</textarea></p>";
echo "<p><label class='label-small_new' style='width:15%'>Autodial Ratio</label><input type=text class='form_new form_new_amend' name='autodial_pacing' id='autodial_pacing' style='font-size:12px;width:15%' value='".($mastersdata["autodialercampaign"])."'></p>";
if(!isset($mastersdata["trackerfields"]))$mastersdata["trackerfields"]="";
$trackerfieldsarr=array_unique(array_filter(explode(",",$mastersdata["trackerfields"])));
$toarr=array();
$optionsstr="";
$fileids=explode(",",$kformlib->HRFiledsStr);
foreach($fileids as $fileid)
{
if(trim($fileid)!='')
{
if(strstr($kformlib->HRFileFieldsStr,$fileid))$ftype='File';
else if(strstr($kformlib->HRDateFilds,$fileid))$ftype='Date';
else if(strstr($kformlib->HRDropFilds,$fileid))$ftype='Dropdown';
else $ftype='Text';
$toarr[$fileid]=$kformlib->HRFieldNames[$fileid]." ($ftype)";
}
}
asort($toarr);
foreach($trackerfieldsarr as $key)$optionsstr.="<option value='$key' selected>$toarr[$key]</option>";
foreach($toarr as $key=>$opts)$optionsstr.="<option value='$key'>$opts</option>";
?>
<script>
$('body').on('focus',".datetimepicker", function(){
$(this).datetimepicker({format: 'HH:mm'});
});
$(document).ready(function(){
});
</script>
<?php
}
?>