<?php define("PAGENAME", "Home"); session_start(); include '../common/Config.php'; include '../common/DatabaseConnection.php'; if (!isset($_SESSION['artefactUser'])) { header("Location: ../../index.php"); } $user = $_SESSION['artefactUser']; $obj = new DatabaseConnection(); $conn = $obj->createConnection(); $fullName = ""; $location = ""; $locationFK = ""; $userPK = ''; $userRole = ''; $user1 = $obj->setQuery("select u.FirstName,u.LastName,u.UserPk,u.RoleFk,u.LocationFK,l.Description from user u inner join archivelocation l on u.LocationFk = l.LocationPk where u.AbhyasiID = '{$user}'"); if ($user1->num_rows == 1) { while ($row = $user1->fetch_assoc()) { $fullName = $row['FirstName'] . " " . $row['LastName']; $location = $row['Description']; $locationFK = $row['LocationFK']; $userPK = $row['UserPk']; $userRole = $row['RoleFk']; } $_SESSION['userLoc'] = $locationFK; $_SESSION['userPK'] = $userPK; $_SESSION['userRole'] = $userRole; $_SESSION['userLocationDesc'] = $location; $_SESSION['fullName'] = $fullName;
<?php ini_set('max_execution_time', 30000); include_once 'DatabaseConnection.php'; $type = $_GET['type']; session_start(); $_SESSION['type'] = $type; $db = new DatabaseConnection(); $conn = $db->createConnection(); $parentArray = array(); //Associate Array with ArtefactCode and ArtefactPID //$single = array('Photos'); $NoChild = array(); //Query to Get Parent elements $parentQuery = "select artefactname,artefactcode from artefact\n\t\t\t\twhere artefactPID is null and artefactTypeCode='{$type}' and visiblestatus='on' order by CreatedDate DESC"; //echo $parentQuery; $result = $db->setQuery($parentQuery); if ($result->num_rows > 0) { while ($row = $result->fetch_assoc()) { $parentArray[$row['artefactcode']] = $row['artefactname']; //echo '>>'.$row['artefactcode'].'>>'.$row['artefactname'].'</br>'; } } else { echo "Sorry No Data for this Artefact..."; } $childrenArray = array(); //Associate Array with ParentArtefactCode and array(Child: ArtefactCode and ArtefactName) //Query to Get Children $childChild = array(); //to store parent->child[This Name... Code is in associate array]->child foreach ($parentArray as $parentCode => $parentValue) {
<?php include_once '../common/DatabaseConnection.php'; include 'mail.php'; require 'PHPMailerAutoload.php'; $db1 = new DatabaseConnection(); $db1->createConnection(); $res = wwwcopy("todayTask.php"); $sqlC = "select\n\t\t\t\ts.ScheduleMaintenancePK,\n\t\t\t\ts.ArtefactCode,\n\t\t\t\ta.ArtefactName,\n\t\t\t\ts.ScheduledServiceDate\n\t\t\t\tfrom scheduledmaintenance s\n\t\t\t\tinner join artefact a\n\t\t\t\ton s.ArtefactCode = a.ArtefactCode\n\t\t\t\twhere s.ScheduleMaintenancePK\n\t\t\t\tnot in (select ScheduleMaintenanceFK from tasklist)\n\t\t\t\tand s.ScheduledServiceDate <= current_date()\n\t\t\t\tand a.visiblestatus='on'"; $resu1 = $db1->setQuery($sqlC); if ($resu1->num_rows > 0) { $sql1 = "select FirstName,LastName,EmailId\n\t\t\t\t\tfrom user"; $resu1 = $db1->setQuery($sql1); if ($resu1->num_rows > 0) { while ($r = $resu1->fetch_assoc()) { $name = $r['FirstName'] . " " . $r['LastName']; $email = $r['EmailId']; $res1 = str_replace("{{user}}", $name, $res); echo sendMail($email, $res1); } } }