本文整理汇总了PHP中Reference::delete_all方法的典型用法代码示例。如果您正苦于以下问题:PHP Reference::delete_all方法的具体用法?PHP Reference::delete_all怎么用?PHP Reference::delete_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Reference
的用法示例。
在下文中一共展示了Reference::delete_all方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
function other_info($employee_id = '')
{
$data['page_name'] = '<b>Personal Data Sheet</b>';
$data['section_name'] = '<b>Personal Information</b>';
$data['focus_field'] = 'skill';
$data['msg'] = '';
$e = new Employee_m();
$data['employee'] = $e->get_by_id($employee_id);
if (Input::get('op')) {
// OTHER INFORMATION=========================
$skills = Input::get('skill');
$recognition = Input::get('recognition');
$membership_organization = Input::get('membership_organization');
$o = new Other_info();
$o->get_by_employee_id($employee_id);
$o->delete_all();
$i = 0;
foreach ($skills as $skill) {
$o = new Other_info();
$o->employee_id = $employee_id;
$o->special_skills = $skills[$i];
$o->recognition = $recognition[$i];
$o->membership_organization = $membership_organization[$i];
$o->save();
$i++;
}
// QUESTIONS=======================================
$questions = Input::get('q');
$answer = Input::get('q');
$details = Input::get('details');
$q = new Question();
$q->get_by_employee_id($employee_id);
// Delete Questions
$q->delete_all();
$i = 0;
$count = 0;
foreach ($questions as $question) {
$count += 1;
$q = new Question();
$q->employee_id = $employee_id;
$q->question_no = $count;
$q->answer = $answer[$i];
$q->details = $details[$i];
$q->save();
$i++;
}
// REFERENCE
$names = Input::get('ref_name');
$address = Input::get('ref_address');
$no = Input::get('ref_tel');
$r = new Reference();
$r->get_by_employee_id($employee_id);
$r->delete_all();
$i = 0;
foreach ($names as $name) {
$r = new Reference();
$r->employee_id = $employee_id;
$r->name = $names[$i];
$r->address = $address[$i];
$r->tel_no = $no[$i];
$r->ctc_no = Input::get('ctc_no');
$r->issue_at = Input::get('issue_at');
$r->issue_on = Input::get('issue_on');
$r->save();
$i++;
}
$data['msg'] = 'Other Information has been saved!';
}
// Other information============================================
$o = new Other_info();
$data['infos'] = $o->get_by_employee_id($employee_id);
// Question ====================================================
$q = new Question();
$data['question_options'] = array('0' => 'No', '1' => 'Yes');
$data['question1'] = $q->get_question($employee_id, 1);
$data['question2'] = $q->get_question($employee_id, 2);
$data['question3'] = $q->get_question($employee_id, 3);
$data['question4'] = $q->get_question($employee_id, 4);
$data['question5'] = $q->get_question($employee_id, 5);
$data['question6'] = $q->get_question($employee_id, 6);
$data['question7'] = $q->get_question($employee_id, 7);
$data['question8'] = $q->get_question($employee_id, 8);
$data['question9'] = $q->get_question($employee_id, 9);
$data['question10'] = $q->get_question($employee_id, 10);
// References=================================================
$r = new Reference();
$data['references'] = $r->get_by_employee_id($employee_id);
$data['selected'] = $e->office_id;
//Use for office listbox
$data['options'] = $this->options->office_options();
$data['employee_id'] = $employee_id;
$data['main_content'] = 'other_info';
return View::make('includes/template', $data);
}