本文整理汇总了PHP中Students类的典型用法代码示例。如果您正苦于以下问题:PHP Students类的具体用法?PHP Students怎么用?PHP Students使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Students类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: get_by_id
public function get_by_id($id)
{
$student = null;
//database connect
$this->db->connect();
//query
$sql = "SELECT * FROM students WHERE id=?";
//execute
$stmt = $this->db->initStatement($sql);
$stmt->bind_param("i", $id);
$stmt->execute();
$stmt->bind_result($id, $first_name, $last_name, $email, $contact_no, $course);
while ($stmt->fetch()) {
//put in object
$student = new Students();
$student->set_id($id);
$student->get_id();
$student->set_first_name($first_name);
$student->set_last_name($last_name);
$student->set_email($email);
$student->set_contact_no($contact_no);
$student->set_course($course);
}
$this->db->close();
return $student;
}
开发者ID:pratishshr,项目名称:leapfrog,代码行数:26,代码来源:studentrepository.class.php
示例2: __construct
function __construct()
{
$url = isset($_GET['url']) ? $_GET['url'] : null;
$url = rtrim($url, '/');
$url = explode('/', $url);
//print_r($url);
if ($url[0] == 'services') {
if (isset($url[2])) {
require 'services/' . $url[1] . '.php';
$controller = new Students();
$controller->selectById($url[2]);
return false;
} else {
if (isset($url[1])) {
require 'services/' . $url[1] . '.php';
$controller = new Students();
$controller->index();
return false;
}
}
} else {
if (empty($url[0])) {
require 'controllers/index.php';
$controller = new Index();
$controller->index();
return false;
}
$file = 'controllers/' . $url[0] . '.php';
if (file_exists($file)) {
require $file;
} else {
$this->error();
}
$controller = new $url[0]();
$controller->loadModel($url[0]);
if (isset($url[2])) {
if (method_exists($controller, $url[1])) {
$controller->{$url[1]}($url[2]);
} else {
$this->error();
}
} else {
if (isset($url[1])) {
if (method_exists($controller, $url[1])) {
$controller->{$url[1]}();
} else {
$this->error();
}
} else {
$controller->index();
}
}
}
}
开发者ID:varrbor,项目名称:smartSystems,代码行数:54,代码来源:Bootstrap.php
示例3: create
public static function create()
{
if (!isset($student_instance)) {
self::$student_instance = new Students();
}
return self::$student_instance;
}
开发者ID:NTC-EAST,项目名称:EAST-Website,代码行数:7,代码来源:students.php
示例4: exportSelected
public function exportSelected()
{
$selected_students = Input::get('studentId');
if (is_array($selected_students)) {
//Setup CSV
$csv = \League\Csv\Writer::createFromFileObject(new \SplTempFileObject());
$column_flag = false;
$student = [];
foreach ($selected_students as $student_id) {
$student_data = Students::with('course')->find($student_id);
//Personal data
$student['firstname'] = $student_data['firstname'];
$student['surname'] = $student_data['surname'];
$student['email'] = $student_data['email'];
//Course data
$student['university'] = $student_data->course['university'];
$student['course_name'] = $student_data->course['course_name'];
//Check whether column headers have been set (not ideal for large datasets)
if ($column_flag === false) {
$csv->insertOne(\Schema::getColumnListing('student'));
$column_flag = true;
}
//Add student record to file
$csv->insertOne($student);
}
} else {
return "NO STUDENTS SELECTED";
}
//is_array($selected_students)
$csv->output("selected_student_records.csv");
}
开发者ID:ZeroGodForce,项目名称:RMP_Challenge_Me,代码行数:31,代码来源:ExportController.php
示例5: save
/**
*
* Переобъявляем сохранение
*
**/
public function save()
{
$student = Students::model()->findByPk(Yii::app()->my->id);
$student->settings = json_encode($this->_attributes);
$student->save();
$_SESSION["settings"] = $student->settings;
}
开发者ID:Kapodastr,项目名称:grow,代码行数:12,代码来源:Settings.php
示例6: run
public function run()
{
$students = array(array("surname" => "Dare", "firstname" => "Koby", "nationality" => "UK", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Dicki", "firstname" => "Kelli", "nationality" => "UK", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Carter", "firstname" => "Golden", "nationality" => "UK", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Koch", "firstname" => "Emory", "nationality" => "UK", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kilback", "firstname" => "Marjorie", "nationality" => "Dominican Republic", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Hoeger", "firstname" => "Ernest", "nationality" => "Panama", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Hudson", "firstname" => "Rebecca", "nationality" => "Chile", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Hirthe", "firstname" => "Josefina", "nationality" => "Kyrgyzstan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Ebert", "firstname" => "Wanda", "nationality" => "Palau", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Denesik", "firstname" => "Burnice", "nationality" => "Kuwait", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Moen", "firstname" => "Harold", "nationality" => "Vatican City", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Spencer", "firstname" => "Brennon", "nationality" => "Cambodia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Ziemann", "firstname" => "Stanley", "nationality" => "Azerbaijan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Rempel", "firstname" => "Forest", "nationality" => "Seychelles", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Zboncak", "firstname" => "Gregory", "nationality" => "Kazakhstan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Weimann", "firstname" => "Valentine", "nationality" => "Turks and Caicos Islands", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Waelchi", "firstname" => "Alexandria", "nationality" => "People's Democratic Republic of Yemen", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Altenwerth", "firstname" => "Florian", "nationality" => "Wake Island", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Zieme", "firstname" => "Faye", "nationality" => "Guatemala", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Beatty", "firstname" => "Raleigh", "nationality" => "British Antarctic Territory", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kuhic", "firstname" => "Dolly", "nationality" => "Paraguay", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Koepp", "firstname" => "Mikel", "nationality" => "Liberia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Pfannerstill", "firstname" => "May", "nationality" => "Puerto Rico", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Douglas", "firstname" => "Otho", "nationality" => "Denmark", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Conroy", "firstname" => "Napoleon", "nationality" => "Afghanistan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Doyle", "firstname" => "Elza", "nationality" => "Liechtenstein", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Schulist", "firstname" => "Maci", "nationality" => "United States", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Hansen", "firstname" => "Kyler", "nationality" => "Canada", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Conn", "firstname" => "Jean", "nationality" => "Kiribati", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Yost", "firstname" => "Reilly", "nationality" => "South Africa", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Quigley", "firstname" => "Shad", "nationality" => "Bhutan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Quitzon", "firstname" => "Beatrice", "nationality" => "Timor-Leste", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Langworth", "firstname" => "Lonny", "nationality" => "New Zealand", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kiehn", "firstname" => "Rosalinda", "nationality" => "Dominican Republic", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Parker", "firstname" => "Rebekah", "nationality" => "Kyrgyzstan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kuhlman", "firstname" => "Rhoda", "nationality" => "Gibraltar", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Cruickshank", "firstname" => "Judd", "nationality" => "Macau SAR China", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Yundt", "firstname" => "Sarah", "nationality" => "Papua New Guinea", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Pacocha", "firstname" => "Russ", "nationality" => "Greenland", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Purdy", "firstname" => "Kali", "nationality" => "Mauritania", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Block", "firstname" => "Janick", "nationality" => "Belarus", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Waelchi", "firstname" => "Ford", "nationality" => "Paraguay", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Batz", "firstname" => "Francesca", "nationality" => "Netherlands Antilles", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Rogahn", "firstname" => "Lukas", "nationality" => "Cape Verde", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Funk", "firstname" => "Wilhelmine", "nationality" => "Zimbabwe", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Nader", "firstname" => "Jude", "nationality" => "Panama Canal Zone", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Stroman", "firstname" => "Frankie", "nationality" => "Saint Martin", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Jaskolski", "firstname" => "Mina", "nationality" => "Bermuda", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Zieme", "firstname" => "Mack", "nationality" => "Uzbekistan", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Tromp", "firstname" => "Celestine", "nationality" => "Peru", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Nitzsche", "firstname" => "Zella", "nationality" => "New Zealand", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kuphal", "firstname" => "Ila", "nationality" => "Maldives", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Cruickshank", "firstname" => "Eda", "nationality" => "Jamaica", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Koepp", "firstname" => "Jaylen", "nationality" => "Monaco", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kohler", "firstname" => "Kristina", "nationality" => "Russia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Ondricka", "firstname" => "Sean", "nationality" => "Turks and Caicos Islands", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Leuschke", "firstname" => "Estelle", "nationality" => "Niue", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Funk", "firstname" => "Roselyn", "nationality" => "Djibouti", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Romaguera", "firstname" => "Kariane", "nationality" => "Djibouti", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Nitzsche", "firstname" => "Adrian", "nationality" => "Guernsey", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Windler", "firstname" => "Maggie", "nationality" => "Guernsey", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Blanda", "firstname" => "Ken", "nationality" => "French Southern Territories", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Reilly", "firstname" => "Antone", "nationality" => "Yemen", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Cassin", "firstname" => "Yadira", "nationality" => "Mayotte", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Macejkovic", "firstname" => "Marge", "nationality" => "Slovakia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Feest", "firstname" => "Rogers", "nationality" => "Monaco", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Fadel", "firstname" => "Candelario", "nationality" => "Belarus", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Shields", "firstname" => "Eldridge", "nationality" => "Neutral Zone", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Romaguera", "firstname" => "Lavina", "nationality" => "Canton and Enderbury Islands", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Hessel", "firstname" => "Matt", "nationality" => "Czech Republic", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Donnelly", "firstname" => "Barrett", "nationality" => "South Korea", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Hagenes", "firstname" => "Betty", "nationality" => "Samoa", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Schmeler", "firstname" => "Alphonso", "nationality" => "Palau", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Shields", "firstname" => "Selmer", "nationality" => "Samoa", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kemmer", "firstname" => "Earl", "nationality" => "Niger", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kunde", "firstname" => "Sharon", "nationality" => "French Guiana", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Jacobs", "firstname" => "Jeffry", "nationality" => "Albania", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Ritchie", "firstname" => "Eliane", "nationality" => "Chad", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Erdman", "firstname" => "Howard", "nationality" => "Puerto Rico", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Schimmel", "firstname" => "Lance", "nationality" => "Serbia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Tillman", "firstname" => "Elliott", "nationality" => "Botswana", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Boyle", "firstname" => "Emanuel", "nationality" => "Tokelau", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Feest", "firstname" => "Norma", "nationality" => "Georgia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "O'Conner", "firstname" => "Jenifer", "nationality" => "Nepal", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Towne", "firstname" => "Lilliana", "nationality" => "New Caledonia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Padberg", "firstname" => "Verner", "nationality" => "Seychelles", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Stiedemann", "firstname" => "Adelia", "nationality" => "Greece", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Turcotte", "firstname" => "Tristin", "nationality" => "Nauru", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Pouros", "firstname" => "Cooper", "nationality" => "Micronesia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Romaguera", "firstname" => "Judy", "nationality" => "Australia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Tremblay", "firstname" => "Maxie", "nationality" => "French Guiana", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Barrows", "firstname" => "Akeem", "nationality" => "Mozambique", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Funk", "firstname" => "Florencio", "nationality" => "Malawi", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Welch", "firstname" => "Margarita", "nationality" => "Ethiopia", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Legros", "firstname" => "Helmer", "nationality" => "Antigua and Barbuda", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Labadie", "firstname" => "Carole", "nationality" => "Martinique", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Klein", "firstname" => "Desiree", "nationality" => "Nepal", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Kuvalis", "firstname" => "Eloy", "nationality" => "Panama Canal Zone", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Macejkovic", "firstname" => "Lucinda", "nationality" => "Austria", "email" => "[email protected]", "address_id" => rand(0, 88), "course_id" => rand(0, 199)), array("surname" => "Bosco", "firstname" => "Emilia", "nationality" => "São Tomé and Príncipe", "email" => "[email protected]"));
foreach ($students as $student) {
Students::create($student);
}
}
开发者ID:ZeroGodForce,项目名称:RMP_Challenge_Me,代码行数:7,代码来源:StudentsTableSeeder.php
示例7: actionView
/**
* Displays a particular model.
* @param integer $id the ID of the model to be displayed
*/
public function actionView($id)
{
if (isset($_POST['idProfile']) && isset($_POST['idEssay']) && isset($_POST['stardate']) && isset($_POST['enddate'])) {
if (!empty($_POST['idProfile']) && !empty($_POST['idEssay']) && !empty($_POST['stardate']) && !empty($_POST['enddate'])) {
$essay = $this->loadModel($id);
$model = new EssaysHasCrugeUser();
$idStudent = Students::model()->find('profile_id=' . $_POST['idProfile'])->id;
$model->status = 1;
$model->stardate = strtotime($_POST['stardate']);
$model->enddate = strtotime($_POST['enddate']);
$model->essays_id = $_POST['idEssay'];
$model->title_essay = $essay->getNameTitleEssay($idStudent, $essay->colleges_has_majors_colleges_id, $essay->type_essay_id, $_POST['idEssay']);
$model->students_id = $idStudent;
/* echo "<pre>";
echo print_r($model->enddate);
echo "</pre>";
Yii::app()->end(); */
if ($model->save()) {
Yii::app()->user->setFlash('save', 'El Estudiante se ha agregado correctamente.');
$this->redirect(array('view', 'id' => $model->essays_id));
}
}
Yii::app()->user->setFlash('error', 'Debe seleccionar un Estudiante, la fecha de inicio y culminación del Essay.');
$this->redirect(array('view', 'id' => $_POST['idEssay']));
}
$this->render('view', array('model' => $this->loadModel($id)));
}
开发者ID:argenis1763,项目名称:vc,代码行数:31,代码来源:EssaysController.php
示例8: studentname
public function studentname($data, $row)
{
$student = Students::model()->findByAttributes(array('id' => $data->student_id));
if ($student != NULL) {
return ucfirst($student->first_name) . ' ' . ucfirst($student->last_name);
} else {
return '-';
}
}
开发者ID:SoftScape,项目名称:open-school-CE,代码行数:9,代码来源:ExamScores.php
示例9: map_data
private function map_data()
{
$student = new Students();
$student->set_first_name($_POST['first_name']);
$student->set_last_name($_POST['last_name']);
$student->set_email($_POST['email']);
$student->set_contact_no($_POST['contact_no']);
$student->set_course($_POST['course_id']);
return $student;
}
开发者ID:pratishshr,项目名称:leapfrog,代码行数:10,代码来源:studentcontroller.php
示例10: _map_posted_data
private function _map_posted_data()
{
$students = new Students();
$students->set_first_name($_POST['first_name']);
$students->set_last_name($_POST['last_name']);
$students->set_email($_POST['email']);
$students->set_contact_no($_POST['contact_no']);
$students->set_course($_POST['course']);
return $students;
}
开发者ID:pratishshr,项目名称:leapfrog,代码行数:10,代码来源:studentenquirycontroller.php
示例11: execute
private function execute($query)
{
$data = null;
$pdoData = Students::getPDO()->prepare($query);
$pdoData->execute();
$responseMassage = $pdoData->errorInfo();
//Объект с сообщением и кодом о проведеной операции
if ($responseMassage[0] == 0) {
//если выборка прошла то ....
$data = $pdoData;
}
return $data;
}
开发者ID:andxbes,项目名称:wingoHW13,代码行数:13,代码来源:students.php
示例12: login
public static function login()
{
$input = Input::all();
$sid = Students::checkStudent($input['email'], $input['password']);
if ($sid && $sid != 2) {
Session::put('sid', $sid);
return Redirect::to('/students');
} elseif ($sid && $sid == 2) {
return Redirect::to('/students/login')->withErrors(array("msg" => "Password is invalid. Please Try again."));
} else {
return Redirect::to('/students/login')->withErrors(array("msg" => "Sorry!! Student of this email id does not exist."));
}
}
开发者ID:mahaverick,项目名称:InternsApp,代码行数:13,代码来源:StudentsController.php
示例13: actionBatch
public function actionBatch()
{
if (isset($_POST['batch'])) {
$data = Students::model()->findAll('batch_id=:x', array(':x' => $_POST['batch']));
}
// echo CHtml::tag('option', array('value' => 0), CHtml::encode('Select'), true);
$data = CHtml::listData($data, 'id', 'phone1');
foreach ($data as $phoneno) {
if ($phoneno != "") {
echo $phoneno;
echo ",";
}
}
}
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:14,代码来源:SendbatchController.php
示例14: actionAddpoint
public function actionAddpoint($id)
{
$student = Students::model()->findByPk($id);
$bonus = new Points();
if (isset($_REQUEST['Points'])) {
$data = $_REQUEST['Points'];
$bonus->student = $data['student'];
$bonus->earned = $data['earned'];
$bonus->comment = $data['comment'];
$bonus->by = $data['by'];
if ($bonus->save()) {
Yii::app()->notify->add("Бонус добавлен");
} else {
Yii::app()->notify->addErrors($bonus->getErrors());
}
}
$this->render('addpoint', array('student' => $student, "point" => $bonus));
}
开发者ID:Kapodastr,项目名称:grow,代码行数:18,代码来源:StudentsController.php
示例15: actionStudent
public function actionStudent()
{
if (isset($_POST['studentuser'])) {
$students = Students::model()->findAll(array('condition' => 'uid=:x and is_deleted=:y', 'params' => array(':x' => 0, ':y' => 0), 'limit' => '1000', 'order' => 'id ASC'));
if ($students != NULL) {
foreach ($students as $student) {
$user = new User();
$profile = new Profile();
if ($student->email != NULL) {
$user->username = substr(md5(uniqid(mt_rand(), true)), 0, 10);
$user->email = $student->email;
$user->activkey = UserModule::encrypting(microtime() . $student->first_name);
$password = substr(md5(uniqid(mt_rand(), true)), 0, 10);
$user->password = UserModule::encrypting($password);
$user->superuser = 0;
$user->status = 1;
if ($user->save()) {
//assign role
$authorizer = Yii::app()->getModule("rights")->getAuthorizer();
$authorizer->authManager->assign('student', $user->id);
//profile
$profile->firstname = $student->first_name;
$profile->lastname = $student->last_name;
$profile->user_id = $user->id;
$profile->save();
//saving user id to students table.
$student->saveAttributes(array('uid' => $user->id));
UserModule::sendMail($student->email, UserModule::t("You are registered from {site_name}", array('{site_name}' => Yii::app()->name)), UserModule::t("Please login to your account with your email id as username and password {password}", array('{password}' => $password)));
$flash = "User created successfully";
$type = 'success';
}
} else {
$flash = "No email id given";
$type = 'error';
}
}
}
Yii::app()->user->setFlash($type, $flash);
$this->redirect(array('/importcsv'));
} else {
$this->render('/default/student');
}
}
开发者ID:akilraj1255,项目名称:rajeshwari,代码行数:43,代码来源:UsersController.php
示例16: actionIndex
/**
* Specifies the access control rules.
* This method is used by the 'accessControl' filter.
* @return array access control rules
*/
public function actionIndex()
{
$criteria = new CDbCriteria();
$criteria->condition = '';
$roles = Rights::getAssignedRoles(Yii::app()->user->id);
// ch
|
请发表评论