本文整理汇总了PHP中Connection::getArray方法的典型用法代码示例。如果您正苦于以下问题:PHP Connection::getArray方法的具体用法?PHP Connection::getArray怎么用?PHP Connection::getArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Connection
的用法示例。
在下文中一共展示了Connection::getArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deanIds
function deanIds()
{
$c = new Connection();
$sql_dean = "SELECT stakeholder_id, Position\n FROM stakeholderhasranks \n WHERE Rank LIKE 'Associate Dean' \n OR\n Rank LIKE 'Dean'";
$r = $c->query($sql_dean);
if ($c->getNumRows($r) != 0) {
while ($row = $c->getArray($r)) {
$temp[] = $row;
}
}
return $temp;
}
示例2: explode
// it searches by lastname and gives you stakeholder_id, if two people are same last name its your duty to tell which one is correct one!
// by checking sfu_id or email address
// .
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////// First part search with last Name //////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// In this file we send html tables and buttoms to the source file, so each button has id upon on his limited term id thus we can customize it (unable edditable or delete button) /////
$h = "";
if ($_REQUEST["srch_lmt"] != "") {
//echo "1_____________________________________________________________________________________________";
$ar = explode('-', trim($q_2));
// echo "sfu_id =".$ar[3];
$stakeholder_id = "SELECT stakeholder_id,LastName,FirstName,Emplid FROM stakeholders where stakeholders.Emplid = ('" . $ar[3] . "')";
$res = $c->query($stakeholder_id);
if ($c->getNumRows($res) != 0) {
while ($row1 = $c->getArray($res)) {
$list1[] = $row1;
}
}
$hint1 = "";
if ($stakeholder_id !== "") {
foreach ($list1 as $name1) {
$hint1['stakeholder_id'] = $name1['stakeholder_id'];
$hint1['LastName'] = $name1['LastName'];
$hint1['FirstName'] = $name1['FirstName'];
$hint1['Emplid'] = $name1['Emplid'];
}
}
$s_id = $hint1['stakeholder_id'];
$_SESSION['sta_id'] = $s_id;
// echo "____________________________________________________________________________________________________";
示例3: Connection
$c = new Connection();
session_start();
if (isset($_SESSION['sta_id_q2'])) {
unset($_SESSION['sta_id_q2']);
}
if (isset($_SESSION['sta_id'])) {
unset($_SESSION['sta_id']);
}
$q_2 = $_REQUEST["q"];
//$q_2= 853071439;
//
$srt17 = "select stakeholder_id from stakeholders where stakeholders.Emplid = '" . $q_2 . "' ";
//echo $srt17;
$r517 = $c->query($srt17);
if ($c->getNumRows($r517) != 0) {
while ($row917 = $c->getArray($r517)) {
$temq27[] = $row917;
//$_SESSION['sta_id']= $row97['stakeholder_id'];
}
}
foreach ($temq27 as $name) {
$hi917['stakeholder_id'] = $name['stakeholder_id'];
}
$_SESSION['sta_id'] = $hi917['stakeholder_id'];
$sql = "\t\t\n select *\n From stakeholders \n LEFT JOIN addresses \n on stakeholders.Stakeholder_id = addresses.Stakeholder_id \n LEFT JOIN phonenumbers\n on stakeholders.Stakeholder_id = phonenumbers.Stakeholder_id\n JOIN emailaddresses\n LEFT JOIN educationhistory\n on stakeholders.Stakeholder_id = educationhistory.Stakeholder_id \n WHERE\n stakeholders.Emplid= TRIM('" . $q_2 . "') \n\t\t\t\t";
$result = $c->query($sql);
$co = count($c->getArray($result)) - 1;
if ($c->getNumRows($result) != 0) {
while ($co) {
$row = $c->getArray($result);
$losi[] = $row;
示例4: TRIM
// }
// }
// $hmn = "";
// foreach ($cosi as $n) {
// $hmn['max(limited_term_id)'] = $n['max(limited_term_id)'];
// }
//echo $lim_id = $hmn['max(limited_term_id)'];
$sthid = 973009094;
$flag_found = 0;
$address_id = 0;
$sql_6 = "SELECT Preferred,Address_id FROM addresses WHERE Stakeholder_id = TRIM('{$sthid}')";
//echo $sql9;
// $rese = ($c->query($limited_term_id));
$rese_6 = $c->query($sql_6);
if ($c->getNumRows($rese_6) != 0) {
while ($rolin = $c->getArray($rese_6)) {
$cosi[] = $rolin;
}
$hmn = "";
foreach ($cosi as $n) {
$hmn['Preferred'] = $n['Preferred'];
$hmn['Address_id'] = $n['Address_id'];
}
foreach ($hmn as $mn) {
if ($hmn['Preferred'] = 'Yes') {
$address_id = $hmn['Address_id'];
$flag_found = 1;
}
}
// echo $address_id;
$sql69 = "SELECT * FROM addresses WHERE Address_id = TRIM('{$address_id}')";
示例5: while
// {
// while($rows = $c->getArray($r))
// {
// $arr_tempo[]= $rows;
// }
// }
// foreach($arr_tempo as $name)
// {
// $hi97['study_leave_application_id'] = $name['study_leave_application_id'];
// }
// $_SESSION["std_leave_app_id"] = $hi97['study_leave_application_id'];
//
// // }
// echo "stydy leave: ".$_SESSION["std_leave_app_id"];
//
$sql_last = "SELECT study_leave_application_id FROM study_leave_application\nORDER BY study_leave_application_id DESC\nLIMIT 1;";
$result_2 = $c->query($sql_last);
if ($c->getNumRows($result_2) != 0) {
while ($row_2 = $c->getArray($result_2)) {
$list_2[] = $row_2;
// echo $list['LastName'];
}
}
foreach ($list_2 as $nn) {
$std_leave_id = $nn['study_leave_application_id'];
}
session_start();
$_SESSION['stdl_id'] = $std_leave_id;
echo $std_leave_id;
?>
示例6: unset
unset($_SESSION['sta_id_q2']);
}
if (isset($_SESSION['sta_id'])) {
unset($_SESSION['sta_id']);
}
$q_22 = $_REQUEST["q1_data"];
// echo nl2br("\n");
// if(strrpos($q_22, "sfu.ca") || strrpos($q_22, "SFU.CA")){
$q_22 = strstr($q_22, "@", true);
//$q_22 ="wuschke";
//
$srt7 = "select stakeholder_id from stakeholders where stakeholders.ComputingID = '" . $q_22 . "' ";
//echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
//$_SESSION['sta_id']= $row97['stakeholder_id'];
}
}
foreach ($temq2 as $name) {
$hi97['stakeholder_id'] = $name['stakeholder_id'];
}
$_SESSION['sta_id'] = $hi97['stakeholder_id'];
//$_SESSION['sta_id'] = $hi97['stakeholder_id'];
//echo "session=".$_SESSION['sta_id'];
$sql = "\t\t\n select *\n From stakeholders \n LEFT JOIN addresses \n on stakeholders.Stakeholder_id = addresses.Stakeholder_id \n LEFT JOIN phonenumbers\n on stakeholders.Stakeholder_id = phonenumbers.Stakeholder_id\n JOIN emailaddresses\n LEFT JOIN educationhistory\n on stakeholders.Stakeholder_id = educationhistory.Stakeholder_id \n WHERE\n stakeholders.ComputingID = TRIM('" . $q_22 . "')";
$resultdata = $c->query($sql);
echo $sql;
$codata = count($c->getArray($resultdata)) - 1;
if ($c->getNumRows($resultdata) != 0) {
示例7: while
$institution_name2 = $_REQUEST["institution_name2"];
$institution_name3 = $_REQUEST["institution_name3"];
$institution_name_city_1 = $_REQUEST["institution_name_city_1"];
$institution_name_city_2 = $_REQUEST["institution_name_city_2"];
$institution_name_city_3 = $_REQUEST["institution_name_city_3"];
$country_edu_1 = $_REQUEST["country_edu_1"];
$country_edu_2 = $_REQUEST["country_edu_2"];
$country_edu_3 = $_REQUEST["country_edu_3"];
$currently_employed = $_REQUEST["currently_employed"];
$position = $_REQUEST["position"];
$prefer = "Yes";
//////////////////////////// To check is there exist a preferd address or not/////////////////////////////////////////////////////////////
$srt_add = "select Address_id from addresses where addresses.Stakeholder_id = '" . $sth_id . "' and addresses.Preferred = 'Yes' ";
$r57_add = $c->query($srt_add);
if ($c->getNumRows($r57_add) != 0) {
while ($row_add = $c->getArray($r57_add)) {
$tem_add[] = $row_add;
}
}
foreach ($tem_add as $name_add) {
$hi_add['Address_id'] = $name_add['Address_id'];
}
if ($hi_add['Address_id'] > 1) {
$sql7 = "UPDATE addresses SET \n Address1 = '{$address1}',\n City = '{$city}',\n Province = '{$state}',\n Country = '{$country}',\n PostalCode = '{$postal_code}',\n moved_from = '{$moved_from}',\n Type = '{$add_type}',\n Preferred = '{$prefer}'\n WHERE addresses.Stakeholder_id = '" . $sth_id . "' AND addresses.Preferred = 'Yes' ";
} else {
$sql7 = "INSERT INTO addresses (Stakeholder_id,Address1,City,Province,Country,PostalCode,moved_from,Type,Preferred )" . " values ('{$sth_id}','{$address1}','{$city}','{$state}','{$country}','{$postal_code}','{$moved_from}','{$add_type}','{$prefer}')";
}
//echo "sql7=== ".$sql7;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////// To check is there exist a preferd emaill address or not/////////////////////////////////////////////////////////////
$srt_em = "select Email_id from emailaddresses where emailaddresses.Stakeholder_id = '" . $sth_id . "' and emailaddresses.Preferred = '" . $prefer . "' ";
示例8: Connection
} else {
$layout->generateHeader();
}
//echo $_SESSION['sms_userComputingID'];
$sthid = $_SESSION['sms_userStakeholderID'];
//echo $_SESSION['sms_userName'];
// $sthid = 10159;
$sthid = 10724;
$c = new Connection();
$h = '';
$sql = "SELECT * FROM stakeholders WHERE stakeholder_id = '" . $sthid . "' ";
$result = $c->query($sql);
if ($c->getNumRows($result) == 0) {
return false;
}
while ($row = $c->getArray($result)) {
$h['LastName'] = $row['LastName'];
$h['FirstName'] = $row['FirstName'];
}
///////////////////////////////////////////// Start find department ////////////////////////////////////////////////////////////////////////
$count_deps = 0;
$sql_dep = "SELECT * \n FROM stakeholderhasranks sth\n LEFT JOIN bus_rank_has_pad brhp ON sth.ranks_id = brhp.rank_id\n LEFT JOIN bus_pad_lut bpl ON bpl.pad_id = brhp.pad_id \n INNER JOIN bus_rank_lut AS brl ON sth.Rank = brl.Rank AND brl.EmploymentGroupNumNew = 1\n WHERE sth.stakeholder_id = '" . $sthid . "' \n AND (DATE(NOW()) > sth.StartDate \n OR (sth.StartDate = '0000-00-00' )\n OR (sth.StartDate IS NULL ) )";
$results_dep = $c->query($sql_dep);
// if($c->getNumRows($results_dep) == 0)
// return false;
while ($rows = $c->getArray($results_dep)) {
$h['Name' . $count_deps] = $rows['Name'];
$h['PrimaryRank' . $count_deps] = $rows['PrimaryRank'];
$h['Rank'] = $rows['Rank'];
$count_deps += 1;
}
示例9: Connection
<?php
$c = new Connection();
$sth_id = $_SESSION['sms_userStakeholderID'];
$sth_id = 10724;
session_start();
$_SESSION['$flag_inpro'] = 0;
//echo " <script>
// $('[name=edit_button]').click(function()
// {
// alert(\"DDDDDD\");
// });</script> ";
$srt7 = "select * from study_leave_application where study_leave_application.stakeholder_id = '" . $sth_id . "' ";
//echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
//$_SESSION['sta_id']= $row97['stakeholder_id'];
}
}
foreach ($temq2 as $name) {
// $hi97['study_leave_application_id'] = $name['study_leave_application_id'];
// $hi97['DateModified'] = $name['DateModified'];
// " href='/ltd_appt/study_leave_entry_2.php/".$h_1["study_leave_application_id"]."
$hi97[] = $name;
}
echo "<br><br><br>";
echo "<script> </script>";
echo "<table class=\" table table-bordered table-hover \">";
echo "<tr class=\"info\"> <td>Number</td> <td> Date Created </td> <td>Start Date </td> " . "<td>End Date </td> <td>Status of Application</td><td> Change </td></tr>";
foreach ($hi97 as $h_1) {
示例10: Connection
include_once "../sms/admin/_models/Courses.php";
include_once "../sms/admin/_models/Contract-Teaching.php";
include_once "../sms/admin/_inc/helper.php";
include_once "../sms/admin/_controllers/SimpleDataEntryController.php";
$c = new Connection();
// $_SESSION['lm_let_id'] = 35;
// $_SESSION["limited_term_id"]=470;
// $_SESSION["sta_id"] =973008450;
$_SESSION["new/ret"] = "New";
// echo $_SESSION['rec_le'][1]['LastName'];
// final version of getting things from an array!!!!!!
$srt7 = "select * from limited_term_letter where limited_term_letter.limited_term_letter_id = '" . $_SESSION['lm_let_id'] . "' ";
//echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
}
}
foreach ($temq2 as $name) {
$hi97['para_1'] = $name['para_1'];
$hi97['para_2'] = $name['para_2'];
$hi97['para_3'] = $name['para_3'];
$hi97['para_4'] = $name['para_4'];
$hi97['para_5'] = $name['para_5'];
$hi97['para_6'] = $name['para_6'];
$hi97['para_7'] = $name['para_7'];
$hi97['para_8'] = $name['para_8'];
$hi97['para_9'] = $name['para_9'];
$hi97['title'] = $name['title'];
$hi97['relocation'] = $name['relocation'];
示例11: while
// $sfu_id = $_REQUEST["sfu_id"];
// $email = $_REQUEST["email"];
// $citizenship = $_REQUEST["Citizenship"];
// $gender = $_REQUEST["Gender"];
// $former = $_REQUEST["former"];
// $address1 = $_REQUEST["Address1"];
// $pn =$_REQUEST["Phonenumber"];
// $city = $_REQUEST["City"];
// $country=$_REQUEST["Country"];
//
// $q1 = $_REQUEST["position"];
// it only returns the ones who have lastname and sfuid,
$smb = "select stakeholder_id from stakeholders where stakeholders.Emplid = ('" . $_SESSION['sfuid'] . "') ";
$r = $c->query($smb);
if ($c->getNumRows($r) != 0) {
while ($row9 = $c->getArray($r)) {
$list9[] = $row9;
}
}
$hint9 = "";
foreach ($list9 as $name) {
$hint9['stakeholder_id'] = $name['stakeholder_id'];
}
$s = $hint9['stakeholder_id'];
$_SESSION["iddd"] = $hint9['stakeholder_id'];
/*First here we make a stakeholder_ID based on his lastname */
// $sql2 = "UPDATE stakeholders SET FirstName='".$first_name."',PreferredFirstName='".$preferredFirstName."',SFU_ID='".$sfu_id."', Citizenship='".$citizenship."' , Gender='".$gender."'"
// ."Where stakeholders.stakeholder_id = ('".$s."')";
//$last_name = $_REQUEST["last_name"];
// $q1 = $_REQUEST["position"];
/*First here we make a stakeholder_ID based on his lastname */
示例12: foreach
}
}
$hint_info = "";
if ($info !== "") {
foreach ($list_info as $me1) {
$hint_info['LastName'] = $me1['LastName'];
$hint_info['FirstName'] = $me1['FirstName'];
$hint_info['Emplid'] = $me1['Emplid'];
$hint_info['VisaExpireyDate'] = $me1['VisaExpireyDate'];
// echo $me1['LastName'];
}
}
$c = new Connection();
$info2 = "SELECT AnnualSalary FROM limited_term_salary_lut where limited_term_salary_lut.stakeholder_id = ('" . $h_1['Stakeholder_id'] . "')";
$res2 = $c->query($info2);
while ($row2 = $c->getArray($res2)) {
$list_info2[] = $row2;
}
// $hint_info2 = "";
// if ($info2 !== "") {
foreach ($list_info2 as $me2) {
$hint_info2['AnnualSalary'] = $me2['AnnualSalary'];
}
// }
$access = new UserAccessController();
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////// Compute the semesters /////////////////////////////////////////////////////////////////////////
$day_rate = $h_1['salary'];
$day_rate = $day_rate / 10;
// $dw = date("Y-m-d H:i:s"). substr((string)microtime(), 1, 0);
$tempDate = $h_1['appointment_end_date'];
示例13: while
$preferredFirstName = $_REQUEST["PreferredFirstName"];
$sfu_id = $_REQUEST["sfu_id"];
$email = $_REQUEST["email"];
$citizenship = $_REQUEST["Citizenship"];
$gender = $_REQUEST["Gender"];
$former = $_REQUEST["former"];
$address1 = $_REQUEST["Address1"];
$pn = $_REQUEST["Phonenumber"];
$city = $_REQUEST["City"];
$country = $_REQUEST["Country"];
$q1 = $_REQUEST["position"];
// it only returns the ones who have lastname and sfuid,
$smb = "select stakeholder_id from stakeholders where stakeholders.Emplid = ('" . $_SESSION['sfuid'] . "') ";
$r = $c->query($smb);
if ($c->getNumRows($r) != 0) {
while ($row9 = $c->getArray($r)) {
$list9[] = $row9;
}
}
$hint9 = "";
foreach ($list9 as $name) {
$hint9['stakeholder_id'] = $name['stakeholder_id'];
}
$s = $hint9['stakeholder_id'];
$_SESSION["iddd"] = $hint9['stakeholder_id'];
/*First here we make a stakeholder_ID based on his lastname */
$sql2 = "UPDATE stakeholders SET FirstName='" . $first_name . "',PreferredFirstName='" . $preferredFirstName . "',SFU_ID='" . $sfu_id . "', Citizenship='" . $citizenship . "' , Gender='" . $gender . "'" . "Where stakeholders.stakeholder_id = ('" . $s . "')";
//$last_name = $_REQUEST["last_name"];
// $q1 = $_REQUEST["position"];
/*First here we make a stakeholder_ID based on his lastname */
// $sql2 = "INSERT INTO stakeholders (LastName) values ('".$last_name."')";
示例14: Connection
include_once "../sms/admin/_models/Courses.php";
include_once "../sms/admin/_models/Contract-Teaching.php";
include_once "../sms/admin/_inc/helper.php";
include_once "../sms/admin/_controllers/SimpleDataEntryController.php";
//$c = new Connection();
$c = new Connection();
#For a given date, identify the term it belongs to
//SELECT * FROM `terms_lut` WHERE '2015-06-03' BETWEEN StartDate AND EndDate
$leave_option_id = $_REQUEST['leave_option_id'];
$sth_id = $_REQUEST['sth_id'];
// this hardcode is only for test
//$sth_id = 10724;
$srt7 = "select * from bus_tp_journal where bus_tp_journal.Stakeholder_Id = '" . $sth_id . "' ";
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
}
$count_teaching = 0;
foreach ($temq2 as $name) {
$hi97['StartTerm'][] = $name['StartTerm'];
// $hi97['EndTerm'][] = $name['EndTerm'];
// $hi97['Code_Id'][] = $name['Code_Id'];
// echo "Type= ".gettype($name['StartTerm']);
$year = substr($name['StartTerm'], 0, 3);
$term = substr($name['StartTerm'], 3, 4);
$term = intval($term);
if ($term == 4) {
$term = 2;
} else {
if ($term == 7) {
示例15: Connection
<?php
include_once "../sms/admin/_inc/config.php";
include_once "../sms/admin/_theme/Theme.php";
include_once "../sms/admin/_controllers/UserAccessController.php";
include_once "../sms/admin/_models/Courses.php";
include_once "../sms/admin/_models/Contract-Teaching.php";
include_once "../sms/admin/_inc/helper.php";
include_once "../sms/admin/_controllers/SimpleDataEntryController.php";
//$c = new Connection();
$c = new Connection();
#For a given date, identify the term it belongs to
//SELECT * FROM `terms_lut` WHERE '2015-06-03' BETWEEN StartDate AND EndDate
$srt7 = "select * from stakeholderhasranks where stakeholderhasranks.stakeholder_id = '" . $s . "' ";
//echo $srt7;
$r57 = $c->query($srt7);
if ($c->getNumRows($r57) != 0) {
while ($row97 = $c->getArray($r57)) {
$temq2[] = $row97;
}
}
foreach ($temq2 as $name) {
$hi97['ranks_id'] = $name['ranks_id'];
}
$sql = " INSERT INTO limited_term \n (Stakeholder_id,department,department2) \nVALUES ('{$s}','{$department}','{$department2}')";
if ($c->query($sql) === TRUE) {
// echo "New record created successfully"."<br />".$_SESSION['sfuid']."<br />".$sql;
} else {
// echo "Error: " . $sql . "<br>" . $c->error;
}