File manager - Edit - /home/autoph/public_html/voc/home/save_new_clearance_form.php
Back
<?php include 'core/init.php'; //$connect_error = 'Sorry, we\'re experiencing connection problem. Please try again later... Thank you!'; //mysql_connect('localhost','root','aee1024') or die ($connect_error); //mysql_select_db('db_vts') or die($connect_error); //error_reporting(1); $compID= $user_data['company']; ?> <?php //if submit/ save to databasevar if(isset($_POST['done'])){ $positionType = mysql_escape_string($_POST['positionType']); $myUser = mysql_escape_string($_POST['myUser']); $myDate = mysql_escape_string($_POST['myDate']); $empName = mysql_escape_string($_POST['empName']); $empIDNO = mysql_escape_string($_POST['empIDNO']); $empDateHired = mysql_escape_string($_POST['empDateHired']); $empPositionTitle = mysql_escape_string($_POST['empPositionTitle']); $empSharedServices = mysql_escape_string($_POST['empSharedServices']); $empEmploymentStatus = mysql_escape_string($_POST['empEmploymentStatus']); $empDesignation = mysql_escape_string($_POST['empDesignation']); $empUnitAssignment = mysql_escape_string($_POST['empUnitAssignment']); $empCompany = mysql_escape_string($_POST['empCompany']); $reasonOfClearance = mysql_escape_string($_POST['reasonOfClearance']); $empOtherComment = mysql_escape_string($_POST['empOtherComment']); $empFROM = mysql_escape_string($_POST['empFROM']); $empTO = mysql_escape_string($_POST['empTO']); $empInclusive = mysql_escape_string($_POST['empInclusive']); //===================================================================================================================================================== //===================================================================================================================================================== mysql_query("INSERT INTO emp_clearance (position_type, emp_id, comp_id,shared_service,created_by,effectivity_date,position_title,emp_name,emp_status,date_hired,emp_dept,reason_of_clearance,reason_notes,from_origin,to_origin,department,designation) VALUES('{$positionType}','{$empIDNO}','{$empCompany}','{$empSharedServices}','{$myUser}','{$empInclusive}','{$empPositionTitle}','{$empName}','{$empEmploymentStatus}','{$empDateHired}','{$empUnitAssignment}','{$reasonOfClearance}','{$empOtherComment}','{$empFROM}','{$empTO}','{$empUnitAssignment}','{$empDesignation}')"); switch($positionType){ case 'RNF': if($empCompany!='AHG'){ $getApproving = mysql_query("SELECT * FROM emp_clearing_department WHERE tag='$empCompany' AND RNF = 'Yes' || tag = 'AHG' AND RNF = 'Yes' ORDER BY id ASC"); }else{ $getApproving = mysql_query("SELECT * FROM emp_clearing_department WHERE tag='$empCompany' AND RNF = 'Yes' ORDER BY id ASC"); } while($row=mysql_fetch_array($getApproving)){ $accArea = $row['main_area']; $accSubArea = $row['sub_area']; $OfficerA = $row['clearing_officer_primary']; $OfficerB = $row['clearing_officer_secondary']; mysql_query("INSERT INTO emp_clearance_data(emp_id, accountability_areas, unit_department,approving_officer_A,approving_officer_B,date_posted) VALUES('{$empIDNO}','{$accArea}','{$accSubArea}','{$OfficerA}','{$OfficerB}','{$myDate}')"); } echo "RNF. New Clearance Form has been created. Please update signatory list and post to start routing."; break; case 'MGR': if($empCompany!='AHG'){ $getApproving = mysql_query("SELECT * FROM emp_clearing_department WHERE tag='$empCompany' AND MGR = 'Yes' || tag='AHG' AND MGR = 'Yes' ORDER BY id ASC"); }else{ $getApproving = mysql_query("SELECT * FROM emp_clearing_department WHERE tag='$empCompany' AND MGR = 'Yes' ORDER BY id ASC"); } while($row=mysql_fetch_array($getApproving)){ $accArea = $row['main_area']; $accSubArea = $row['sub_area']; $OfficerA = $row['clearing_officer_primary']; $OfficerB = $row['clearing_officer_secondary']; mysql_query("INSERT INTO emp_clearance_data(emp_id, accountability_areas, unit_department,approving_officer_A,approving_officer_B,date_posted) VALUES('{$empIDNO}','{$accArea}','{$accSubArea}','{$OfficerA}','{$OfficerB}','{$myDate}')"); } echo "MGR. New Clearance Form has been created. Please update signatory list and post to start routing."; break; case 'EXE': if($empCompany!='AHG'){ $getApproving = mysql_query("SELECT * FROM emp_clearing_department WHERE tag='$empCompany' AND EXE = 'Yes' || tag='AHG' AND EXE = 'Yes'ORDER BY id ASC"); }else{ $getApproving = mysql_query("SELECT * FROM emp_clearing_department WHERE tag='$empCompany' AND EXE = 'Yes' ORDER BY id ASC"); } while($row=mysql_fetch_array($getApproving)){ $accArea = $row['main_area']; $accSubArea = $row['sub_area']; $OfficerA = $row['clearing_officer_primary']; $OfficerB = $row['clearing_officer_secondary']; mysql_query("INSERT INTO emp_clearance_data(emp_id, accountability_areas, unit_department,approving_officer_A,approving_officer_B,date_posted) VALUES('{$empIDNO}','{$accArea}','{$accSubArea}','{$OfficerA}','{$OfficerB}','{$myDate}')"); } echo "EXE. New Clearance Form has been created. Please update signatory list and post to start routing."; break; } exit(); } ?>
| ver. 1.4 |
.
| PHP 7.3.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings