$result = execute_sqlUpdate('tblAppUsers', array('emplPassword' => md5($newPassword)), array('emplUsername' => $USERNAME)); send_Action_Response('Success', 'Updated!'); } exit; break; case 'updateUserInfo': $name = get_POST_var("name"); $email = get_POST_var("email"); $mobile = get_POST_var("mobile"); $designation = get_POST_var("designation"); $Timezone = get_POST_var("Timezone"); $existingEmail = executesql_returnArray("select emplEmail_id from tblAppUsers where empl_id!='{$CURRENT_USERID}' AND emplEmail_id='{$email}'"); if ($existingEmail) { send_Action_Response('Fail', 'Email Already Exists !'); } else { $result = execute_sqlUpdate('tblAppUsers', array('emplEmail_id' => $email, 'emplFullName' => $name, 'emplMobileNo' => $mobile, 'emplDesignation' => $designation, 'TimeZone' => $Timezone), array('empl_id' => $CURRENT_USERID)); send_Action_Response('Success', 'Updated!'); } exit; break; case 'sendUserInvitation': $fName = get_POST_var("fname"); $lName = get_POST_var("lname"); $eMail = get_POST_var("email"); $msg = get_POST_var("msg"); $roomid = ''; $MU = new ManageUsers(); $MU->userId = $CURRENT_USERID; $existingEmail = $MU->checkFor_User_Email_Existence($eMail); if ($existingEmail) { send_Action_Response('Fail', 'Email already exists !');
public function closeWork($workID) { global $DE_GLOBALS_WORK_CLOSED; global $DE_GLOBALS_WORK_NEW; global $DE_GLOBALS_WORK_TASKONTASK; $currentTimeStamp = get_currentPHPTimestamp(); $success = execute_sqlUpdate("WORKS", array(work_status => $DE_GLOBALS_WORK_CLOSED, work_closedDate => $currentTimeStamp), array(workID => $workID)); // Appear in List any tasks having $workID as 'afterCompletionID' $success = execute_sqlUpdate("WORKS", array(work_status => $DE_GLOBALS_WORK_NEW), array(afterCompletionID => $workID, work_status => $DE_GLOBALS_WORK_TASKONTASK)); }
<?php include_once "include_db.php"; include_once "include_functions.php"; $target_path = "./attachments/" . $_SESSION["subdomain"] . "/"; $sqlquery = "select Id as attach_id, workid, diskfilename, uploadname from attachments"; $query = mysql_query($sqlquery) or die("Invalid query: " . mysql_error()); while ($row = @mysql_fetch_array($query)) { extract($row); // $attach_id, $workid, $diskfilename, $uploadname $file = $target_path . $diskfilename; $fp = fopen($file, 'r'); $fp_size = filesize($file); $filecontent = bin2hex(fread($fp, $fp_size)); execute_sqlUpdate("attachments", array(filesize => $fp_size, filecontent => $filecontent), array(Id => $attach_id)); echo " inserted file {$uploadname} <BR>"; }
public function Restore_Room($roomId) { $MU = new ManageUsers(); $MU->userId = $_SESSION['empl_id']; if (!$MU->isAdminUser()) { return false; } $result = execute_sqlUpdate('tblRooms', array('roomActive' => 'Y'), array('roomId' => $roomId)); return true; }
include_once "include_db.php"; include_once "include_custom.php"; function send_Action_Response($RESP, $MSG) { echo "Response: " . $RESP . "\n"; echo "ResponseMessage: " . $MSG; exit; } $ACTION = @$_POST["action"]; $USERNAME = $_SESSION['loggedinUser']; // $_SESSION['loggedinUser'] = $_SERVER['PHP_AUTH_USER'] ; switch ($ACTION) { case 'updatePwd': $currentPwd = @$_POST["currentPwd"]; $newPwd = @$_POST["newPwd"]; execute_sqlUpdate("users", array(user_pwd => $newPwd), array(username => $USERNAME, user_pwd => $currentPwd)); send_Action_Response('Success', 'password updated !'); exit; break; case 'deleteTask': $taskid = @$_POST["taskid"]; $query = mysql_query("delete from journalentries where jid='{$taskid}' and task_user='******'"); send_Action_Response('Success', 'Entry deleted !'); exit; break; case 'addnewtask': $nutask_date = @$_POST["nutask_date"]; $nutask_duration = @$_POST["nutask_duration"]; $nutask_desc = @$_POST["nutask_desc"]; $nutask_project = @$_POST["nutask_project"]; // if( $nutask_date == getTomorrowCaldate(-1) || $nutask_date == getTomorrowCaldate(0) || $nutask_date == getTomorrowCaldate(1) ){
case 'updateTasksStatus': $dclid = get_POST_var('dclid'); $task_status = get_POST_var('task_status'); $result = execute_sqlUpdate("dailychecklist", array(status => $task_status), array(username => $USERNAME, dclid => $dclid)); send_Action_Response('Success', "Status Reset !"); exit; break; case 'deleteDailyRoutineTask': $dclid = get_POST_var('dclid'); $result = mysql_query("delete from dailychecklist where username='******' and dclid='{$dclid}' "); send_Action_Response('Success', "deleted daily routine task !"); exit; break; case 'newIcalURL': $new_Key = getaRandomString(32); $result = execute_sqlUpdate("users", array('remindersicalkey' => $new_Key), array('username' => $USERNAME)); send_Action_Response('Success', "ical key was reset !"); exit; break; case 'getJsonEventsForCalendarView': $tasks = array(); $twomonths_ago = date("Y-m-d", strtotime("-2 month")); $fourmonths_fromnow = date("Y-m-d", strtotime("+4 month")); $sqlquery = "select work_deadLine, workID, work_briefDesc, work_RTID from works_todolist where work_deadLine > '{$twomonths_ago}' and work_deadLine < '{$fourmonths_fromnow}' and work_userAssigned = '{$USERNAME}' "; $query = mysql_query($sqlquery) or die("Invalid query: " . mysql_error()); while ($row = @mysql_fetch_array($query)) { // extract($row) ; // $work_deadLine, workID, work_briefDesc, work_RTID list($evYear, $evMonth, $evDay) = explode('-', $row['work_deadLine']); $ntask = array(); $ntask['tY'] = $evYear; $ntask['tM'] = $evMonth;