本文整理汇总了PHP中Subject::setConnector方法的典型用法代码示例。如果您正苦于以下问题:PHP Subject::setConnector方法的具体用法?PHP Subject::setConnector怎么用?PHP Subject::setConnector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Subject
的用法示例。
在下文中一共展示了Subject::setConnector方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getListForStudent
public function getListForStudent($student, $order = "data_esame")
{
$order = trim(filter_var($order, FILTER_SANITIZE_STRING));
//interrogazione tabella
$sql = "select * from appelli where id_piano = '{$student->id_plan}' and id_appello not in (select id_appello from prenotazioni where id_studente = '{$student->id}') ORDER BY {$order}";
$auth = $this->connector->query($sql);
$list = array();
// controllo sul risultato dell'interrogazione
if (mysql_num_rows($auth) > 0) {
$plan = new Plan();
$plan->setConnector($this->connector);
$subject = new Subject();
$subject->setConnector($this->connector);
while ($res = $this->connector->getObjectResult($auth)) {
$book = new Booking($res->id_appello, $res->id_piano, $res->id_materia, $res->anno, $res->docente, $res->data_esame);
//Calcolo le informazioni di servizio
$currPlan = $plan->getById($book->plan_id);
$book->course_name = $currPlan->course_name;
$book->plan_code = $currPlan->plan_code;
$book->subject_name = $subject->getById($book->subject_id)->name;
$list[] = $book;
}
}
return $list;
}
示例2: storeFormValues
public function storeFormValues($params)
{
if (isset($params['savePlan'])) {
list($course_id, $subject_string) = explode("#", $params['savePlan'], 2);
$plan_code = trim(filter_var($params['codicePiano'], FILTER_SANITIZE_STRING));
$plan_id = (int) $params['id_piano'];
//Questa variabile viene valorizzata solo in caso di modifica
//formatto le materie
if ($subject_string != "") {
$materie = explode(",", $subject_string);
}
$lista_subjectPlan = array();
for ($i = 0; $i < count($materie); $i++) {
list($nome_materia, $anno) = explode(":", trim($materie[$i]));
//Informazioni di servizio
$subject = new Subject();
$subject->setConnector($this->connector);
$id_materia = $subject->getByName($nome_materia)->id;
$subjPlan = new SubjectPlan($id_materia, $nome_materia, $anno);
$lista_subjectPlan[] = $subjPlan;
}
$this->__construct($plan_id, $plan_code, $course_id, $lista_subjectPlan);
}
}
示例3: getList
public function getList($studend)
{
// interrogazione della tabella
$sql = "SELECT * FROM esami WHERE id_studente='{$studend->id}'";
$auth = $this->connector->query($sql);
$list = array();
if (mysql_num_rows($auth) > 0) {
while ($res = $this->connector->getObjectResult($auth)) {
$exam = new Exam(get_object_vars($res));
//Calcolo le informazioni di servizio
$plan = new Plan();
$plan->setConnector($this->connector);
$student_plan = $plan->getById($studend->id_plan);
foreach ($student_plan->subjects as $subj) {
if ($exam->id_subject == $subj->subject_id) {
$exam->year = $subj->year;
break;
}
}
$subject = new Subject();
$subject->setConnector($this->connector);
$exam->subject_name = $subject->getById($exam->id_subject)->name;
$list[] = $exam;
}
}
return $list;
}
示例4: showSubject
function showSubject()
{
global $connector;
$subject = new Subject();
$subject->setConnector($connector);
if (isset($_POST['operation'])) {
list($operation, $params) = explode("#", $_POST['operation']);
switch ($operation) {
case 'saveChanges':
$subject->storeFormValues($_POST);
$error_msg = $subject->insert();
if ($error_msg) {
$result['edit'] = $subject;
}
break;
case 'delete':
$error_msg = $subject->delete($params);
break;
case 'edit':
$result['edit'] = $subject->getById($params);
break;
case 'editChanges':
$subject->storeFormValues($_POST);
$error_msg = $subject->update();
break;
default:
$error_msg = "Operazione non valida";
}
if ($error_msg != "") {
$result["errorMessage"] = $error_msg;
} elseif ($operation != 'edit') {
$result["statusMessage"] = "Operazione completata!";
}
}
if (isset($_POST['search'])) {
$result["subjects"] = $subject->search($_POST['search']);
} else {
$result["subjects"] = $subject->getList();
}
$page = "subject.php";
include_once BASE_PATH . "template.php";
}