public function exists(Intervention $intervention) { $q = $this->_db->prepare('SELECT COUNT(*) FROM intervention WHERE id = :id'); $q->bindValue(':id', $intervention->id(), PDO::PARAM_INT); $q->execute(); return (bool) $q->fetchColumn(); }
public function hydrate(array $data = array()) { foreach ($data as $value) { $intervention = new Intervention(); $intervention->hydrate($value); $this[] = $intervention; } }
public function hydrate(array $data = array()) { parent::hydrate($data); if (isset($data['intervention'])) { $this->intervention = new Intervention(); if (!is_array($data['intervention'])) { throw new \Bixev\Rest\Exception\Rest\E400BadRequest('Invalid parameter "intervention"'); } $this->intervention->hydrate($data['intervention']); } if (isset($data['custom_fields'])) { $this->custom_fields = new InterventionReportCustomFields(); if (!is_array($data['custom_fields'])) { throw new \Bixev\Rest\Exception\Rest\E400BadRequest('Invalid parameter "custom_fields"'); } $this->custom_fields->hydrate($data['custom_fields']); } }
/** * Execute the job. * * @return void */ public function handle() { //create dir $storage = storage_path('app'); !file_exists($storage . '/' . $imageModel->id) ? mkdir($storage . '/' . $imageModel->id, 0777, true) : ''; // save file \Intervention::make($this->image)->save($storage . $img_slug); // save relations $this->model->photos()->save($img); }
/** * Store a newly created resource in storage. * * @param PhotosRequest $request * @return \Illuminate\Http\Response */ public function store(PhotosRequest $request) { // input variables $input = \Input::except('item_id', 'item_model', 'item_type', 'image'); $input['slug'] = \trslug::trslug(\Input::get('title')); $input['photo_id'] = \Input::get('item_id'); $input['photo_type'] = \Input::get('item_type'); $input['line'] = 0; // create photo $img = Photos::create($input); // save image slug&&upload $storagepath = storage_path('app') . '/img/photos/' . $img->id; $img->slug = '/img/photos/' . $img->id . '/' . $input['slug'] . '.jpg'; $img->save(); !file_exists($storagepath) ? mkdir($storagepath, 0777, true) : null; \Intervention::make(\Input::file('image'))->save($storagepath . '/' . $input['slug'] . '.jpg'); return \Redirect::back()->with('message', 'Kaydedildi!'); }
/** * Store a newly created resource in storage. * * @param AdminRequest $request * @return \Illuminate\Http\Response */ public function store(AdminRequest $request) { $config['brand'] = \Input::get('brand'); $config['mail'] = \Input::get('mail'); $config['active'] = \Input::get('active'); $config['eng'] = \Input::get('eng'); $config['one_page'] = \Input::get('one_page'); $config['googlemap'] = \Input::get('googlemap'); $config['header'] = \Input::get('header'); if (\Input::file('ico')) { \File::copy(\Input::file('ico'), public_path('favicon.ico')); } \File::put(storage_path('.config'), json_encode($config)); $custom_js = \Input::file('custom_js'); $custom_css = \Input::file('custom_css'); $custom_css ? $custom_css->move(storage_path('app/custom/css'), \trslug::trslug(pathinfo($custom_css->getClientOriginalName(), PATHINFO_FILENAME)) . '.css') : null; $custom_js ? $custom_js->move(storage_path('app/custom/js'), \trslug::trslug(pathinfo($custom_js->getClientOriginalName(), PATHINFO_FILENAME)) . '.js') : null; if (\Input::file('logo')) { \File::cleanDirectory(storage_path('app/img/.cache')); \Intervention::make(\Input::file('logo'))->save(storage_path('app/img/assets/logo.png')); } \Activity::log('Admin Anasayfa Güncellendi'); return \Redirect::back()->with('message', 'Kaydedildi!'); }
public function store_followup($id) { $patient = Patient::find($id); $patient->first_name = Input::get("firstname"); $patient->middle_name = Input::get("middlename"); $patient->last_name = Input::get("lastname"); $patient->birth_date = Input::get("dob"); $patient->hospital_id = Input::get("hosp_no"); $patient->phone = Input::get("phone"); $patient->facility_id = Input::get("facility"); $patient->save(); //adding patient visit info $visit = Visit::create(array("patient_id" => $patient->id, "visit_date" => date('Y-m-d'), "server_status" => 'not', "user" => Auth::user()->firstname . " " . Auth::user()->middlename . " " . Auth::user()->lastname)); //adding address information PatientInfo::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "hospital_id" => "somenumber", "region" => Input::get("region"), "district" => Input::get("district"), "ward" => Input::get("ward"), "ten_cell_leader" => Input::get("t_cell_leadr"))); //adding gynecological history inforamtion for a visit GynecologicalHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "parity" => Input::get("parity"), "number_of_pregnancy" => Input::get("number_of_preg"), "menarche" => Input::get("menarche"), "age_at_sexual_debut" => Input::get("start_sex_age"), "marital_status" => Input::get("marital"), "age_at_first_marriage" => Input::get("first_marriage"), "sexual_partner" => Input::get("sexual_partner"), "partner_sexual_partner" => Input::get("partner_sexual_partner"))); //adding contraceptive history ContraceptiveHistory::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "current_status" => Input::get("current_on_contra"), "current_contraceptive_id" => Input::has("current_contra") ? Input::get("current_contra") : "")); //adding HIV status HivStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::has("hiv_status") ? Input::get("hiv_status") : "", "test_status" => Input::has("hiv_test_status") ? Input::get("hiv_test_status") : "", "unknown_reason" => Input::has("unknown_reason") ? Input::get("unknown_reason") : "", "years_since_first_diagnosis" => Input::has("year_since_diagnosis") ? Input::get("year_since_diagnosis") : "", "year_of_last_test" => Input::has("last_test") ? Input::get("last_test") : "", "art_status" => Input::has("art_status") ? Input::get("art_status") : "", "current_art_status" => Input::has("current_art_status") ? Input::get("current_art_status") : "", "pitc_offered" => Input::get("test_again") == "yes" ? "yes" : "no", "pitc_agreed" => Input::has("test_again") ? Input::get("test_again") : "", "pitc_result" => Input::has("current_test_result") ? Input::get("current_test_result") : "", "pitc_cd4_count" => Input::has("current_cd4") ? Input::get("current_cd4") : "", "prev_cd4_count" => Input::has("prev_cd4") ? Input::get("prev_cd4") : "")); //adding VIA Status ViaStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "via_counselling_status" => Input::get("via_counceling"), "via_test_status" => Input::get("via_test"), "reject_reason" => Input::has("via_reason") ? Input::get("via_reason") : "", "via_result" => Input::has("via_results") ? Input::get("via_results") : "")); //adding colposcopy ColposcopyStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("colposcopy_status"), "result_id" => Input::has("colpo_result") ? Input::get("colpo_result") : "")); //adding Pap smear result PapsmearStatus::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "status" => Input::get("pap_status"), "result_id" => Input::has("pap_result") ? Input::get("pap_result") : "")); //adding intervetion status Intervention::create(array("patient_id" => $patient->id, "visit_id" => $visit->id, "type_id" => Input::has("intervention") ? Input::get("intervention") : "", "indicator_id" => Input::has("indicator") ? Input::get("indicator") : "", "histology_id" => Input::has("histology") ? Input::get("histology") : "", "cancer_id" => Input::has("cancer") ? Input::get("cancer") : "", "grade" => Input::has("hist_grade") ? Input::get("hist_grade") : "", "stages" => Input::has("stages") ? Input::get("stages") : "", "differentiation" => Input::has("differentiation") ? Input::get("differentiation") : "")); $report = PatientReport::where('patient_id', $patient->id)->first(); $report->region = Input::get("region"); $report->district = Input::get("district"); $report->number_of_pregnancy = Input::get("number_of_preg"); $report->marital_status = Input::get("marital"); $report->first_marriage = Input::get("first_marriage"); $report->partners = Input::get("sexual_partner"); $report->partners_partner = Input::get("partner_sexual_partner"); $report->contraceptive_status = Input::get("current_on_contra"); $report->facility_id = Input::get("facility"); if (Input::has("current_contra")) { $report->contraceptive_type = Input::get("current_contra"); } if (Input::has("hiv_status")) { $report->HIV_status = Input::get("hiv_status"); } if (Input::has("current_cd4")) { $report->cd4_count = Input::get("current_cd4"); } elseif (Input::has("prev_cd4")) { $report->cd4_count = Input::has("prev_cd4"); } $report->save(); if (Input::get("next_visit") != "") { Notification::create(array("patient_id" => $patient->id, "message" => "Kumbuka Kwenda katika kituo ulichopimwa mara ya mwisho saratani ya shingo ya kizazi. Tafadhali fika bila kukosa tarehe " . Input::get('next_visit'), "status" => "pending", "phone_number" => $patient->phone, "next_visit" => Input::get('next_visit'))); } Logs::create(array("user_id" => Auth::user()->id, "action" => "Patient followup for " . $patient->first_name . " " . $patient->last_name)); $msg = "Patient followup stored successfull"; return View::make('visit.index', compact('patient', "msg")); }
/** * Adds an object to the instance pool. * * Propel keeps cached copies of objects in an instance pool when they are retrieved * from the database. In some cases -- especially when you override doSelect*() * methods in your stub classes -- you may need to explicitly add objects * to the cache in order to ensure that the same objects are always returned by doSelect*() * and retrieveByPK*() calls. * * @param Intervention $value A Intervention object. * @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally). */ public static function addInstanceToPool(Intervention $obj, $key = null) { if (Propel::isInstancePoolingEnabled()) { if ($key === null) { $key = (string) $obj->getId(); } // if key === null self::$instances[$key] = $obj; } }
$types = Browse::getIntvTypes($record['intervention_record_number']); foreach ($types as $type) { echo get_mt_term($type['type_of_intervention']) . "<br/>"; } ?> </td> </tr> <?php } ?> </tbody> </table> <?php $intv_form = generate_formarray('intervention', 'view'); $intv = new Intervention(); foreach ($intv_list as $key => $record) { echo '<br /><h3>' . _t('INTERVENING_PARTY') . ++$key . ' : ' . $record['person_name'] . '</h3><br />'; //print victim details $person->LoadFromRecordNumber($record['intervening_party']); $person->LoadRelationships(); popuate_formArray($person_form, $person); shn_form_get_html_labels($person_form, false); echo "<br class='page_break' />"; //print act details echo '<h4>' . _t('INTERVENTION') . ' : ' . get_mt_term($record['type_of_intervention']) . '</h4><br />'; $intv->LoadFromRecordNumber($record['intervention_record_number']); $intv->LoadRelationships(); popuate_formArray($intv_form, $intv); shn_form_get_html_labels($intv_form, false); echo "<br class='page_break' />";
public function act_delete_intervention() { if ($_GET['intervention_id']) { $intervention_ids = array($_GET['intervention_id']); } else { $intervention_ids = $_POST['interventions']; } if (!$intervention_ids || isset($_POST['no'])) { set_redirect_header('events', 'intv_list'); return; } $this->intervention_ids = $intervention_ids; $this->del_confirm = true; if (isset($_POST['yes'])) { if (isset($_POST['intervention'])) { array_push($intervention_ids, $_POST['intervention']); } //if multiplt events are selected if (is_array($intervention_ids)) { foreach ($intervention_ids as $intervention) { $i = new Intervention(); $i->DeleteFromRecordNumber($intervention); } } set_redirect_header('events', 'intv_list'); return; } $this->intv_list = Browse::getIntvListArray($intervention_ids); }
//Ouverture du fichier $fe = fopen("./xml/option.xml", "w+"); //Sauvegarde des modifications du fichier d'option fwrite($fe, $xml->saveXML(), strlen($xml->saveXML())); //Fermeture du fichier fclose($fe); //Vérification de l'existence de la table nécessaire au fonctionnement de l'application + Création si nécessaire //Vérification de l'existence de la table tache[xxxx] //Requête de récupération des données $reponse = $base->query('SHOW TABLES FROM vdr_system_gestion LIKE \'tache_' . $year . '\''); $donnees = $reponse->rowCount(); //Si $donnees est vide alors creation de la table if ($donnees == 0) { //Creation des classes "Tache" et "Intervention" $tache = new Tache(); $intervention = new Intervention(); //Nombre de semaine dans l'année $nbresemaine = date("W", mktime(0, 0, 0, 12, 28, $year)); //Définition des semaines de début et fin de campagne d'irrigation $debutcampagne = date("W", mktime(0, 0, 0, 04, 01, $year)); $fincampagne = date("W", mktime(0, 0, 0, 10, 30, $year)); //Creation de la table annuelle tache[xxxx] $tache->creer($base); //Récupération des taches systématiques $listeTache = $intervention->lister($base); //Opérations effectuées sur chacune des lignes récupérées suivant le cycle de l'intervention while ($donnees = $listeTache->fetch()) { $nom_intervention = $donnees['nom_intervention']; $nom_ouvrage = $donnees['nom_ouvrage']; $nom_cycle = $donnees['nom_cycle']; if ($nom_ouvrage == 'Camelas' or $nom_ouvrage == 'Mascareil' or $nom_ouvrage == 'Corbere' or $nom_ouvrage == 'Bouleternere' or $nom_ouvrage == 'Saint Michel' or $nom_ouvrage == 'Espira' or $nom_ouvrage == 'Rivesaltes' or $nom_ouvrage == 'Latour') {
/** * Generates captcha code * @param integer $length [default length of the captcha code] * @return mixed [returns image with the captcha code] */ public function captcha(\Illuminate\Http\Request $request) { $length = $request->input('length', 6); if ($length < 1) { $length = 1; } if ($length > 9) { $length = 9; } $random = rand(pow(10, $length - 1), pow(10, $length) - 1); session()->put('captcha', $random); $img = \Intervention::make('img/captcha/texture.jpg'); /* progressive image */ $img->interlace(); $img->text(session('captcha', $random), rand(51, 57), rand(13, 18), function ($font) use($length) { $font->file('img/captcha/courbd-font.ttf'); $font->size(28 - $length); $font->color('#888888'); $font->align('center'); $font->valign('middle'); $font->angle(rand(-4, 4)); }); /* blur image */ // $img->blur(2); /* just add a tone to the image */ $img->colorize(rand(-20, 20), rand(-20, 20), rand(-20, 20)); return $img->response(); }