本文整理汇总了PHP中student::data_insert_record方法的典型用法代码示例。如果您正苦于以下问题:PHP student::data_insert_record方法的具体用法?PHP student::data_insert_record怎么用?PHP student::data_insert_record使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类student
的用法示例。
在下文中一共展示了student::data_insert_record方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
//.........这里部分代码省略.........
$class = $CURMAN->db->get_record(CLSTABLE, 'idnumber', $clsidnumber);
}
if (empty($class->id) || $update && !empty($class->id)) {
if ($course = $CURMAN->db->get_record(CRSTABLE, 'idnumber', $crsidnumber)) {
/// Do we need to add / update curriculum info for this course???
if (isset($record['curriculum'])) {
if ($cur = $CURMAN->db->get_record(CURTABLE, 'idnumber', $record['curriculum'])) {
$curcrs = $CURMAN->db->get_record(CURCRSTABLE, 'curriculumid', $cur->id, 'courseid', $course->id);
if (!$update && empty($curcrs->id) || $update && !empty($curcrs->id)) {
$cmcrec = array('curriculumid' => $cur->id, 'courseid' => $course->id);
if (!empty($record['frequency'])) {
$cmcrec['frequency'] = $record['frequency'];
}
if (!empty($record['timeperiod'])) {
$cmcrec['timeperiod'] = $record['timeperiod'];
}
if (empty($curcrs->id)) {
$curcrs = new curriculum($cmcrec);
} else {
$curcrs = new curriculum($curcrs->id);
foreach ($cmcrec as $key => $val) {
$curcrs->{$key} = $val;
}
}
$a = new object();
$a->courseid = $course->idnumber;
$a->coursename = $course->name;
$a->curid = $cur->idnumber;
if ($update && !empty($curcrs->id)) {
if ($curcrs->data_update_record() && $verbose) {
$output .= get_string('updated_curriculum_course_info', 'block_curr_admin');
}
} else {
if ($curcrs->data_insert_record() && $verbose) {
$output .= get_string('added_curriculum_course_info', 'block_curr_admin');
}
}
}
}
}
$clsrec = array('courseid' => $course->id, 'idnumber' => $clsidnumber, 'startdate' => $startdate, 'enddate' => $enddate);
if (empty($class->id)) {
$class = new cmclass($clsrec);
} else {
$class = new cmclass($class->id);
foreach ($clsrec as $key => $val) {
$class->{$key} = $val;
}
}
if ($update && !empty($class->id)) {
if ($class->data_update_record() && $verbose) {
$output .= get_string('updated_class_info', 'block_curr_admin') . $class->idnumber . '<br /><br />' . "\n";
}
} else {
if ($class->data_insert_record() && $verbose) {
$output .= get_string('added_class_info', 'block_curr_admin') . $class->idnumber . '<br /><br />' . "\n";
}
}
if (empty($class->id) && $verbose) {
$output .= get_string('error_class_not_created', 'block_curr_admin') . $class->idnumber . '<br /><br />' . "\n";
}
} else {
if ($verbose) {
$output .= get_string('error_course_not_found', 'block_curr_admin') . $crsidnumber . '<br /><br />' . "\n";
}
}