示例#1
0
文件: users.php 项目: pswnr9/TeamW
 public function home($page = "")
 {
     if (!session()) {
         redirect("index.php/users/login");
     }
     if (!isset($_SESSION)) {
         return;
     }
     if (!file_exists(APPPATH . '/views/users/' . $_SESSION['user_type'] . '_home.php')) {
         // Whoops, we don't have a page for that!
         show_404();
     }
     $data = array();
     if ($_POST) {
         $data = escapedata($_POST);
         $check_result = check_register($data, true);
         if (!$check_result["passed"]) {
             $data = $_POST;
             $data['format_error'] = $check_result["error"];
         } else {
             if ($this->account->registerAdminAccount($data)) {
                 redirect("index.php/users/home");
             } else {
                 $data['db_error'] = true;
             }
         }
     }
     if ($_SESSION['user_type'] == 'admin') {
         $data["pending_forms"] = $this->form->getPendingForms();
     }
     $data['title'] = "Home - " . $_SESSION['user_type'];
     $this->load->view('users/' . $_SESSION['user_type'] . '_home', $data);
 }
示例#2
0
文件: forms.php 项目: pswnr9/TeamW
 public function g($page = "all")
 {
     if (!file_exists(APPPATH . '/views/forms/form_' . $page . '.php')) {
         // Whoops, we don't have a page for that!
         show_404();
     }
     if (!session()) {
         redirect("index.php/users/login");
     }
     $data['title'] = "Form - " . $page;
     if ($_POST) {
         $data = preprocess($_POST);
         $check_result = check_forms($data);
         $data = escapedata($data);
         if ($check_result["passed"]) {
             $form_id = $this->form->createFormInfo();
             $eu_info = array('username' => '', 'title' => '', 'organization' => '', 'pawprint' => '', 'empiid' => '', 'address' => '', 'phone_num' => '', 'request_status' => '', 'student_worker' => '', 'if_cur_staff' => '', 'ref_name' => '', 'ref_pos' => '', 'ref_pawprint' => '', 'ref_empiid' => '', 'ferpa_score' => '', 'academic_career' => '', 'access_type' => '');
             foreach ($data as $key => $value) {
                 if (in_array($key, array_keys($eu_info))) {
                     $eu_info[$key] = $value;
                 }
             }
             $eu_info['form_id'] = $form_id;
             $this->form->insertPrepareForm($eu_info);
             //GET FORM_ID
             if (is_numeric($data['access_type2'])) {
                 // case '2':
                 $eu_info = array('basic_inquiry' => '', 'advanced_inquiry' => '', '3Cs' => '', 'advisor_update' => '', 'department_SOC_update' => '', 'service_indicators' => '', 'student_group_view' => '', 'view_study_list' => '', 'registrar_enrollment' => '', 'advisor_student_center' => '', 'class_permission' => '', 'class_permission_view' => '', 'class_roster' => '', 'block_enrollment' => '', 'report_manager' => '', 'self_service_advisor' => '', 'fiscal_officer' => '', 'academic_advising_profile' => '');
                 foreach ($eu_info as $key => $value) {
                     $eu_info[$key] = 0;
                 }
                 foreach ($data as $key => $value) {
                     if (in_array($key, array_keys($eu_info))) {
                         $eu_info[$key] = (int) $value;
                     }
                 }
                 $eu_info['form_id'] = $form_id;
                 $this->form->insertStudentRecordsAccess($eu_info);
             }
             if (is_numeric($data['access_type3'])) {
                 $eu_info = array('act' => '', 'lelts' => '', 'ged' => '', 'sat' => '', 'lsat' => '', 'millers' => '', 'gre' => '', 'mcat' => '', 'rpax' => '', 'gmat' => '', 'ap' => '', 'pla-mu' => '', 'tofel' => '', 'clep' => '', 'base' => '');
                 foreach ($eu_info as $key => $value) {
                     $eu_info[$key] = 0;
                 }
                 foreach ($data as $key => $value) {
                     if (in_array($key, array_keys($eu_info))) {
                         $eu_info[$key] = $value;
                     }
                 }
                 $eu_info['form_id'] = $form_id;
                 $this->form->insertAdmissionsAccess($eu_info);
             }
             if (is_numeric($data['access_type4'])) {
                 $eu_info = array('general_inquiry' => 0, 'cash_group_post' => 0);
                 foreach ($data as $key => $value) {
                     if (in_array($key, array_keys($eu_info))) {
                         $eu_info[$key] = $value;
                     }
                 }
                 $eu_info['form_id'] = $form_id;
                 $this->form->insertStudentFinancialsAccess($eu_info);
             }
             if (is_numeric($data['access_type5'])) {
                 $eu_info = array('fa_cash' => 0, 'fa_non_financial_aid_stuff' => 0);
                 foreach ($data as $key => $value) {
                     if (in_array($key, array_keys($eu_info))) {
                         $eu_info[$key] = $value;
                     }
                 }
                 $eu_info['form_id'] = $form_id;
                 $this->form->insertStudentFinancialAidAccess($eu_info);
             }
             if (is_numeric($data['access_type6'])) {
                 $eu_info = array('immunization_view' => '', 'transfer_credit_admission' => '', 'relationships' => '', 'student_groups' => '', 'accommodate' => '', 'support_staff' => '', 'advance_standing_report' => '');
                 foreach ($eu_info as $key => $value) {
                     $eu_info[$key] = 0;
                 }
                 foreach ($data as $key => $value) {
                     if (in_array($key, array_keys($eu_info))) {
                         $eu_info[$key] = $value;
                     }
                 }
                 $eu_info['form_id'] = $form_id;
                 $this->form->insertReservedAccess($eu_info);
             }
             redirect("index.php/users/home");
         } else {
             //      $test['data'] = $data;
             // $this->load->view("forms/test", $test);
             // return;
             $data = $_POST;
             $data['format_error'] = $check_result['error'];
             $this->load->view("templates/header", $data);
             $this->load->view("forms/form_" . $page, $data);
             $this->load->view("templates/footer", $data);
             return;
         }
     }
     $data = $this->form->getAutoFill($_SESSION['pawprint']);
     $pawprint = $_SESSION['pawprint'];
     $ids = $this->form->getIdByPawprint($pawprint);
     // print_r(var_dump($ids));
     //$ids = array(0~)
     $result = array();
     $i = 0;
     foreach ($ids as $value) {
         $result[$i] = $this->form->getFormById($value);
         $i++;
     }
     //$result[0]->array of five array
     $data["result"] = $result;
     $this->load->view("templates/header", $data);
     $this->load->view("forms/form_" . $page, $data);
     $this->load->view("templates/footer", $data);
 }
示例#3
0
文件: hebconj.php 项目: hftf/hebconj
  <meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8" />
  <title>Hebrew Verb Conjugator</title>
 </head>
 <body>
<?php 
//  str_replace(array('A', 'B', 'C'), array('C', 'D', 'E'), 'ABCABC')
//  str="ABCABC"; rep={A:'C', B:'D', C:'E'}; str.replace(/A|B|C/g, function(x){if(x in rep)return rep[x]})
include "inc/db.php";
mysql_select_db("hebconj");
mysql_query("SET NAMES 'utf8'");
include 'hebconj-functions.php';
$hspell_on = isset($_GET['hspell']);
$color_on = isset($_GET['color']);
$verb_root = escapedata(urldecode(isset($_GET["verb_root"]) ? $_GET["verb_root"] : ""));
$verb_root = fix_sofit($verb_root);
$tense_id = escapedata(isset($_GET["tense_id"]) ? $_GET["tense_id"] : "");
$pronouns = array("אֲנִי<br /><br />", "אַתָּה", "אַתְּ", "הוּא", "הִיא", "אֲנַחְנוּ<br /><br />", "אַתֶּם", "אַתֶּן", "הֵם", "הֵן");
$tenses = array("הוֹוֶה", "עָבָר", "עָתִיד", "צִוּוּי");
$tense_ops = array(1 => array("desc" => "pa'al    - simple active", "tense_name" => "פָּעַל", "hc" => "קל"), 2 => array("desc" => "nif'al   - simple passive", "tense_name" => "נִפְעַל", "hc" => "נפ"), 3 => array("desc" => "pi'el    - intensive active", "tense_name" => "פִּעֵל", "hc" => "פי"), 4 => array("desc" => "pu'al    - intensive passive", "tense_name" => "פֻּעַל", "hc" => "פו"), 5 => array("desc" => "hitpa'el - reflexive", "tense_name" => "הִתְפַּעֵל", "hc" => "הת"), 6 => array("desc" => "hif'il   - causative active", "tense_name" => "הִפְעִיל", "hc" => "הפ"), 7 => array("desc" => "huf'al   - causative passive", "tense_name" => "הֻפְעַל", "hc" => "הו"));
?>
  <p><a href="index.php">Return</a> - <strong><a href="hebconj-list.php">List of Hebrew Verbs</a></strong></p>

  <form id="hebconj" method="get" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
   <p style="text-align:center;" lang="he">
    <span lang="he" class="tm">שֹׁרֶשׁ: </span>
    <input type="text" name="verb_root" id="verb_root" lang="he" value="<?php 
echo $verb_root;
?>