<?php $wfName = Workflow::find('2'); ?> <br/> <!-- PURCHASE REQUEST SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('5'); ?> <div class="panel-title"> <?php $section_name = strtoupper($sectionName->sectionName); $position = 90; $str = substr($section_name, 0, $position) . "<br>" . substr($section_name, $position); echo $str; ?> </div> </div> <div class="panel-body"> <!-- Displays form for adding new tasks to the workflow --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}"> </div>
<?php //Cursor Component //Count Cursor $id = $purchase->id; $docs = DB::table('document')->where('pr_id', '=', $id)->first(); $workflow = DB::table('workflow')->get(); $taskch = TaskDetails::where('doc_id', $docs->id)->where('status', 'New')->orWhere('status', 'Active')->count(); $taskexist = TaskDetails::where('doc_id', $docs->id)->count(); //Get Cursor Value if ($taskch == 0) { $taskc = TaskDetails::where('doc_id', $docs->id)->where('status', 'Done')->orderBy('id', 'DESC')->first(); } else { $taskc = TaskDetails::where('doc_id', $docs->id)->where('status', 'New')->orWhere('status', 'Active')->first(); } //Queries $workflow = Workflow::find($docs->work_id); $section = Section::where('workflow_id', $workflow->id)->orderBy('section_order_id', 'ASC')->get(); $taskd = TaskDetails::where('doc_id', $docs->id)->orderBy('id', 'ASC')->get(); $sectioncheck = 0; $prdays = 0; $lastid = 0; if ($taskexist != 0) { foreach ($section as $sections) { $sectiondays = 0; $task = Task::where('section_id', $sections->section_order_id)->where('wf_id', $workflow->id)->orderBy('order_id', 'ASC')->get(); echo "<div class='panel panel-success'><div class='panel-heading'><h3 class='panel-title'>" . $sections->section_order_id . ". " . $sections->sectionName . "</h3></div>"; echo "<div class='panel-body'>"; echo "<table border='1' class='workflow-table'>"; //Addon Display $otherc = OtherDetails::where('section_id', $sections->id)->count(); if ($otherc != 0) {
<?php $wfName = Workflow::find('5'); ?> <br/> <!-- PURCHASE REQUEST SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('16'); ?> <div class="panel-title"> <?php $section_name = strtoupper($sectionName->sectionName); $position = 90; $str = substr($section_name, 0, $position) . "<br>" . substr($section_name, $position); echo $str; ?> </div> </div> <div class="panel-body"> <!-- Displays form for adding new tasks to the workflow --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}"> </div>
</td> <?php $doc = new Purchase(); $doc = DB::table('document')->where('pr_id', $request->id)->get(); ?> <td width="30%"> @foreach ($doc as $docs) <?php $workflow = Workflow::find($docs->work_id)->workFlowName; if ($workflow == "Small Value Procurement (Below P50,000)") { echo "SVP (Below P50,000)"; } else { if ($workflow == "Small Value Procurement (Above P50,000 Below P500,000)") { echo "SVP (Above P50,000 Below P500,000)"; } else { echo $workflow = Workflow::find($docs->work_id)->workFlowName; } } if ($request->otherType != "Pakyaw" || $request->otherType != "Direct Contracting") { } else { if ($request->otherType != "") { echo "<br> <i>{$request->otherType}</i>"; } } ?> @endforeach </td> <td width="15%"><span class="label {{($request->status == 'New') ? 'label-primary' : (($request->status == 'Active') ? 'label-success' : (($request->status == 'Overdue') ? 'label-danger' : 'label-default'))}}">{{ $request->status; }}</span></td> <td width="15%">{{{ $request->amount }}}</td> </tr> @endforeach
public function create_submit() { //Image Upload $users = DB::table('users')->get(); $purchasecheck = DB::table('purchase_request')->count(); if ($purchasecheck != 0) { $purchase = Purchase::orderby('id', 'DESC')->first(); $docs = Document::orderby('id', 'DESC')->first(); $pr_id = $purchase->id + 1; $doc_id = $docs->id + 1; } else { $pr_id = 1; $doc_id = 1; } foreach (Input::file('file') as $file) { $rules = array('file' => 'required|mimes:png,gif,jpeg,jpg|max:900000000000000000000'); $validator = \Validator::make(array('file' => $file), $rules); $destine = public_path() . "/uploads"; if ($validator->passes()) { $ext = $file->guessClientExtension(); // (Based on mime type) $ext = $file->getClientOriginalExtension(); // (Based on filename) $filename = $file->getClientOriginalName(); $archivo = value(function () use($file) { $filename = str_random(10) . '.' . $file->getClientOriginalExtension(); return strtolower($filename); }); $archivo = value(function () use($file) { $date = date('m-d-Y-h-i-s', time()); $filename = $date . "-" . $file->getClientOriginalName(); return strtolower($filename); }); $attach = new Attachments(); $attach->doc_id = $doc_id; $attach->data = $archivo; $attach->save(); $filename = $doc_id . "_" . $attach->id; $file->move($destine, $archivo); $target_folder = $destine; $upload_image = $target_folder . "/" . $archivo; $thumbnail = $target_folder . "/resize" . $archivo; $actual = $target_folder . "/" . $archivo; // THUMBNAIL SIZE list($width, $height) = getimagesize($upload_image); $newwidth = $width; $newheight = $height; while ($newheight > 525) { $newheight = $newheight * 0.8; $newwidth = $newwidth * 0.8; } $source = $upload_image; $ext = strtolower($ext); $thumb = imagecreatetruecolor($newwidth, $newheight); if ($ext == "jpg" || $ext == "jpeg") { $source = imagecreatefromjpeg($upload_image); } elseif ($ext == "png") { $source = imagecreatefrompng($upload_image); } elseif ($ext == "gif") { $source = imagecreatefromgif($upload_image); } else { continue; } // RESIZE imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height); // MAKE NEW FILES if ($ext == "jpg" || $ext == "jpeg") { imagejpeg($thumb, $thumbnail, 100); } elseif ($ext == "png") { imagepng($thumb, $thumbnail, 9); } elseif ($ext == "gif") { imagegif($thumb, $thumbnail, 100); } else { echo "An invalid image"; } unlink($actual); // FILE RENAMES rename($thumbnail, $actual); } else { $errors = $validator->errors(); Session::put('imgerror', 'Invalid file.'); } } //End Image Upload $purchase = new Purchase(); $document = new Document(); $purchase->projectPurpose = strip_tags(Input::get('projectPurpose')); $purchase->sourceOfFund = strip_tags(Input::get('sourceOfFund')); $purchase->amount = Input::get('amount'); $purchase->office = Input::get('office'); $purchase->requisitioner = Input::get('requisitioner'); if (!Input::get('dateRequested') == '') { $purchase->dateRequested = Input::get('dateRequested'); } $purchase->dateReceived = Input::get('dateReceived'); $purchase->status = 'Active'; $purchase->otherType = Input::get('otherType'); // Get latest control number $cn = Input::get('controlNo'); $checkUniqueControlNo = Purchase::where('controlNo', '=', "{$cn}")->count(); if ($checkUniqueControlNo != 0) { $purchase->controlNo = ''; } else { $purchase->controlNo = Input::get('controlNo'); } if (Input::get('otherType') == 'Pakyaw') { $purchase->projectType = "None"; } else { $purchase->projectType = Input::get('projectType'); } // Set creator id $user_id = Auth::user()->id; $purchase->created_by = $user_id; $purchase_save = $purchase->save(); if ($purchase_save && (Session::get('imgerror') == NULL || !Input::hasfile('file'))) { $document->pr_id = $purchase->id; $document->work_id = Input::get('hide_modeOfProcurement'); $document_save = $document->save(); if ($document_save) { $doc_id = $document->id; $workflow = Workflow::find($document->work_id); $section = Section::where('workflow_id', $document->work_id)->orderBy('section_order_id', 'ASC')->get(); $firstnew = 0; // Set due date; $new_purchase = Purchase::find($purchase->id); $workflow_id = Input::get('hide_modeOfProcurement'); $workflow = Workflow::find($workflow_id); $addToDate = $workflow->totalDays; date_default_timezone_set("Asia/Manila"); $dueDate = date('Y-m-d H:i:s', strtotime("+{$addToDate} days")); $new_purchase->dueDate = $dueDate; $new_purchase->save(); $tasks = Task::where('wf_id', $document->work_id)->orderBy('section_id', 'ASC')->orderBy('order_id', 'ASC')->get(); foreach ($tasks as $task) { $task_details = new TaskDetails(); $task_details->task_id = $task->id; $stringamount = $new_purchase->amount; $stringamount = str_replace(str_split(','), '', $stringamount); $amount = (double) $stringamount; if ($firstnew == 0) { $task_details->status = "New"; } else { $task_details->status = "Pending"; } //Project Type if ($task->taskName == "PRE-PROCUREMENT CONFERENCE" || $task->taskName == "ADVERTISEMENT" || $task->taskName == "PRE-BID CONFERENCE") { $task_details->status = "Lock"; if ($new_purchase->projectType == "Goods/Services") { if ($task->taskName == "PRE-PROCUREMENT CONFERENCE" || $task->taskName == "ADVERTISEMENT") { if ($amount > 2000000) { $task_details->status = "Pending"; } } else { if ($task->taskName == "PRE-BID CONFERENCE") { if ($amount > 1000000) { $task_details->status = "Pending"; } } } } elseif ($new_purchase->projectType == "Infrastructure") { if ($task->taskName == "PRE-PROCUREMENT CONFERENCE" || $task->taskName == "ADVERTISEMENT") { if ($amount > 5000000) { $task_details->status = "Pending"; } } else { if ($task->taskName == "PRE-BID CONFERENCE") { if ($amount > 1000000) { $task_details->status = "Pending"; } } } } elseif ($new_purchase->projectType == "Consulting Services") { if ($amount > 1000000) { $task_details->status = "Pending"; } } } //End Project Type $firstnew = 1; $task_details->doc_id = $document->id; $task_details->save(); } $users = User::all(); foreach ($users as $user) { $count = new Count(); $count->user_id = $user->id; $count->doc_id = $doc_id; $count->save(); } $pr_id = Session::get('pr_id'); DB::table('attachments')->where('doc_id', $doc_id)->update(array('saved' => 1)); DB::table('attachments')->where('saved', '=', 0)->delete(); Session::forget('doc_id'); if (!Input::hasfile('file')) { Session::forget('imgerror'); } $connected = @fsockopen("www.google.com", 80); //website, port (try 80 or 443) if ($connected) { $sendee = DB::table('users')->where('id', $purchase->requisitioner)->first(); $email = $sendee->email; $fname = $sendee->firstname; $data = ['id' => $purchase->id]; Mail::send('emails.template', $data, function ($message) use($email, $fname) { $message->from('*****@*****.**', 'Procurement Tracking System Tarlac'); $message->to($email, $fname)->subject('Tarlac Procurement Tracking System: New Purchase Request Created'); }); $notice = "Purchase request created successfully. "; } else { $notice = "Purchase request created successfully. Email notice was not sent. "; } // Insert data to reports table $date_received = Input::get('dateReceived'); $date_received = substr($date_received, 0, strrpos($date_received, ' ')); $reports = Reports::whereDate($date_received)->first(); if ($reports == null) { $reports = new Reports(); $reports->date = $date_received; $reports->pRequestCount = 1; } else { $reports->pRequestCount = $reports->pRequestCount + 1; } $reports->save(); //End Reports Session::put('notice', $notice); $office = Office::all(); $users = User::all(); $workflow = Workflow::all(); return Redirect::to('purchaseRequest/view'); Session::put('imgsuccess', 'Files uploaded.'); } else { $message = "Failed to create purchase request."; Session::put('main_error', $message); // Get Other Error Messages $error_projectPurpose = $purchase->validationErrors->first('projectPurpose'); $error_projectType = $purchase->validationErrors->first('projectType'); $error_sourceOfFund = $purchase->validationErrors->first('sourceOfFund'); $error_amount = $purchase->validationErrors->first('amount'); $error_office = $purchase->validationErrors->first('office'); $error_requisitioner = $purchase->validationErrors->first('requisitioner'); $error_dateRequested = $purchase->validationErrors->first('dateRequested'); $error_dateReceived = $purchase->validationErrors->first('dateReceived'); $error_controlNo = $purchase->validationErrors->first('controlNo'); // Inserting Error Message To a Session Session::put('error_projectPurpose', $error_projectPurpose); Session::put('error_sourceOfFund', $error_sourceOfFund); Session::put('error_amount', $error_amount); Session::put('error_office', $error_office); Session::put('error_requisitioner', $error_requisitioner); Session::put('error_dateRequested', $error_dateRequested); Session::put('error_dateReceived', $error_dateReceived); Session::put('error_projectType', $error_projectType); Session::put('error_controlNo', $error_controlNo); if ($checkUniqueControlNo != 0) { Session::put('error_controlNo', 'This control no. already exists. Please enter a new one.'); } if (Input::get('hide_modeOfProcurement') == "") { Session::put('m6', 'required'); } Session::put('imgsuccess', 'Files uploaded.'); return Redirect::back()->withInput(); } } else { // Set Main Error $message = "Failed to create purchase request."; Session::put('main_error', $message); if (!Input::hasfile('file')) { Session::forget('imgerror'); } // Get Other Error Messages $error_projectPurpose = $purchase->validationErrors->first('projectPurpose'); $error_projectType = $purchase->validationErrors->first('projectType'); $error_sourceOfFund = $purchase->validationErrors->first('sourceOfFund'); $error_amount = $purchase->validationErrors->first('amount'); $error_office = $purchase->validationErrors->first('office'); $error_requisitioner = $purchase->validationErrors->first('requisitioner'); $error_dateRequested = $purchase->validationErrors->first('dateRequested'); $error_dateReceived = $purchase->validationErrors->first('dateReceived'); $error_controlNo = $purchase->validationErrors->first('controlNo'); // Inserting Error Message To a Session Session::put('error_projectPurpose', $error_projectPurpose); Session::put('error_sourceOfFund', $error_sourceOfFund); Session::put('error_amount', $error_amount); Session::put('error_office', $error_office); Session::put('error_requisitioner', $error_requisitioner); Session::put('error_dateRequested', $error_dateRequested); Session::put('error_dateReceived', $error_dateReceived); Session::put('error_projectType', $error_projectType); Session::put('error_controlNo', $error_controlNo); if ($checkUniqueControlNo != 0) { Session::put('error_controlNo', 'This control no. already exists. Please enter a new one.'); } if (Input::get('hide_modeOfProcurement') == "") { Session::put('error_modeOfProcurement', 'required'); } if (Session::get('imgerror') && Input::hasfile('file')) { $failedpurchasecount = Purchase::where('id', $purchase->id)->count(); if ($failedpurchasecount != 0) { $failedpurchase = Purchase::find($purchase->id); $failedpurchase->delete(); } Session::forget('imgsuccess'); //Image Error Return $task_details = TaskDetails::where('doc_id', $document->id)->delete(); $document->delete(); $message = "Failed to create purchase request."; // Set Main Error $message = "Failed to save purchase request."; Session::put('main_error', $message); // Get Other Error Messages $error_projectPurpose = $purchase->validationErrors->first('projectPurpose'); $error_projectType = $purchase->validationErrors->first('projectType'); $error_sourceOfFund = $purchase->validationErrors->first('sourceOfFund'); $error_amount = $purchase->validationErrors->first('amount'); $error_office = $purchase->validationErrors->first('office'); $error_requisitioner = $purchase->validationErrors->first('requisitioner'); $error_dateRequested = $purchase->validationErrors->first('dateRequested'); $error_dateReceived = $purchase->validationErrors->first('dateReceived'); $error_controlNo = $purchase->validationErrors->first('controlNo'); // Inserting Error Message To a Session Session::put('error_projectPurpose', $error_projectPurpose); Session::put('error_sourceOfFund', $error_sourceOfFund); Session::put('error_amount', $error_amount); Session::put('error_office', $error_office); Session::put('error_requisitioner', $error_requisitioner); Session::put('error_dateRequested', $error_dateRequested); Session::put('error_dateReceived', $error_dateReceived); Session::put('error_projectType', $error_projectType); Session::put('error_controlNo', $error_controlNo); if ($checkUniqueControlNo != 0) { Session::put('error_controlNo', 'This control no. already exists. Please enter a new one.'); } } return Redirect::back()->withInput(); } }
<?php $wfName = Workflow::find('3'); ?> <br/> <!-- PURCHASE REQUEST SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('9'); ?> <div class="panel-title"> <?php $section_name = strtoupper($sectionName->sectionName); $position = 90; $str = substr($section_name, 0, $position) . "<br>" . substr($section_name, $position); echo $str; ?> </div> </div> <div class="panel-body"> <!-- Displays form for adding new tasks to the workflow --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}"> </div>
public function janisawesome() { function generateRandomString($length = 10) { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= $characters[rand(0, strlen($characters) - 1)]; } return $randomString; } function generateRandomAmount() { $length = rand(4, 8); $randomString = ''; for ($i = 0; $i < $length; $i++) { $randomString .= rand(1, 9); } return $randomString; } $numLoop = 1; while ($numLoop < 301) { $purchase = new Purchase(); $document = new Document(); $purchase->projectPurpose = generateRandomString(); $purchase->sourceOfFund = generateRandomString(); $controlAmt = generateRandomAmount(); $controlAmt .= ".00"; $purchase->amount = number_format($controlAmt); $purchase->office = "1"; $purchase->requisitioner = "1"; $purchase->dateRequested = date('Y-m-d H:i:s'); $purchase->dateReceived = date('Y-m-d H:i:s'); $purchase->status = 'Active'; $purchase->otherType = " "; // Get latest control number $cn = 0; $purchase_controlNo = Purchase::orderBy('ControlNo', 'DESC')->first(); if (!$purchase_controlNo == NuLL) { $cn = $purchase_controlNo->controlNo; } $cn += 1; $purchase->controlNo = $cn; if (Input::get('otherType') == ' ') { $purchase->projectType = "None"; } else { $purchase->projectType = "None"; } // Set creator id $user_id = Auth::user()->id; $purchase->created_by = $user_id; $purchase_save = $purchase->save(); if ($purchase_save) { if ($controlAmt < 50000) { $amtControl = 1; } else { if ($controlAmt >= 50000 && $controlAmt <= 500000) { $amtControl = 2; } else { if ($controlAmt >= 500000) { $amtControl = 3; } } } $document->pr_id = $purchase->id; $document->work_id = $amtControl; $document_save = $document->save(); if ($document_save) { $doc_id = $document->id; $workflow = Workflow::find($document->work_id); $section = Section::where('workflow_id', $document->work_id)->orderBy('section_order_id', 'ASC')->get(); $firstnew = 0; // Set due date; $new_purchase = Purchase::find($purchase->id); $workflow_id = "1"; $workflow = Workflow::find($workflow_id); $addToDate = $workflow->totalDays; date_default_timezone_set("Asia/Manila"); $dueDate = date('Y-m-d H:i:s', strtotime("+{$addToDate} days")); $new_purchase->dueDate = $dueDate; $new_purchase->save(); $tasks = Task::where('wf_id', $document->work_id)->orderBy('section_id', 'ASC')->orderBy('order_id', 'ASC')->get(); foreach ($tasks as $task) { $task_details = new TaskDetails(); $task_details->task_id = $task->id; $stringamount = $new_purchase->amount; $stringamount = str_replace(str_split(','), '', $stringamount); $amount = (double) $stringamount; if ($firstnew == 0) { $task_details->status = "New"; } else { $task_details->status = "Pending"; } //Project Type if ($task->taskName == "PRE-PROCUREMENT CONFERENCE" || $task->taskName == "ADVERTISEMENT" || $task->taskName == "PRE-BID CONFERENCE") { $task_details->status = "Lock"; if ($new_purchase->projectType == "Goods/Services") { if ($task->taskName == "PRE-PROCUREMENT CONFERENCE" || $task->taskName == "ADVERTISEMENT") { if ($amount > 2000000) { $task_details->status = "Pending"; } } else { if ($task->taskName == "PRE-BID CONFERENCE") { if ($amount > 1000000) { $task_details->status = "Pending"; } } } } elseif ($new_purchase->projectType == "Infrastructure") { if ($task->taskName == "PRE-PROCUREMENT CONFERENCE" || $task->taskName == "ADVERTISEMENT") { if ($amount > 5000000) { $task_details->status = "Pending"; } } else { if ($task->taskName == "PRE-BID CONFERENCE") { if ($amount > 1000000) { $task_details->status = "Pending"; } } } } elseif ($new_purchase->projectType == "Consulting Services") { if ($amount > 1000000) { $task_details->status = "Pending"; } } } //End Project Type $firstnew = 1; $task_details->doc_id = $document->id; $task_details->save(); } $users = User::all(); foreach ($users as $user) { $count = new Count(); $count->user_id = $user->id; $count->doc_id = $doc_id; $count->save(); } $pr_id = Session::get('pr_id'); DB::table('attachments')->where('doc_id', $doc_id)->update(array('saved' => 1)); DB::table('attachments')->where('saved', '=', 0)->delete(); Session::forget('doc_id'); $connected = true; // $connected = @fsockopen("www.google.com", 80); //website, port (try 80 or 443) if (!$connected) { $sendee = DB::table('users')->where('id', $purchase->requisitioner)->first(); $email = $sendee->email; $fname = $sendee->firstname; $data = ['id' => $purchase->id]; Mail::send('emails.template', $data, function ($message) use($email, $fname) { $message->from('*****@*****.**', 'Procurement Tracking System Tarlac'); $message->to($email, $fname)->subject('Tarlac Procurement Tracking System: New Purchase Request Created'); }); $notice = "Purchase request created successfully. "; // Insert data to reports table $date_received = Input::get('dateReceived'); $date_received = substr($date_received, 0, strrpos($date_received, ' ')); $reports = Reports::whereDate($date_received)->first(); if ($reports == null) { $reports = new Reports(); $reports->date = $date_received; $reports->pRequestCount = 1; } else { $reports->pRequestCount = $reports->pRequestCount + 1; } $reports->save(); //End Reports } else { // Insert data to reports table $date_received = Input::get('dateReceived'); $date_received = substr($date_received, 0, strrpos($date_received, ' ')); $reports = Reports::whereDate($date_received)->first(); if ($reports == null) { $reports = new Reports(); $reports->date = $date_received; $reports->pRequestCount = 1; } else { $reports->pRequestCount = $reports->pRequestCount + 1; } $reports->save(); //End Reports $notice = "Purchase request created successfully. Email notice was not sent. "; } Session::put('notice', $notice); $office = Office::all(); $users = User::all(); $workflow = Workflow::all(); //return Redirect::to('purchaseRequest/view'); return Redirect::to('janisawesome'); Session::put('imgsuccess', 'Files uploaded.'); } else { $message = "Failed to create purchase request."; Session::put('main_error', $message); // Get Other Error Messages $error_projectPurpose = $purchase->validationErrors->first('projectPurpose'); $error_projectType = $purchase->validationErrors->first('projectType'); $error_sourceOfFund = $purchase->validationErrors->first('sourceOfFund'); $error_amount = $purchase->validationErrors->first('amount'); $error_office = $purchase->validationErrors->first('office'); $error_requisitioner = $purchase->validationErrors->first('requisitioner'); $error_dateRequested = $purchase->validationErrors->first('dateRequested'); $error_dateReceived = $purchase->validationErrors->first('dateReceived'); // Inserting Error Message To a Session Session::put('error_projectPurpose', $error_projectPurpose); Session::put('error_sourceOfFund', $error_sourceOfFund); Session::put('error_amount', $error_amount); Session::put('error_office', $error_office); Session::put('error_requisitioner', $error_requisitioner); Session::put('error_dateRequested', $error_dateRequested); Session::put('error_dateReceived', $error_dateReceived); Session::put('error_projectType', $error_projectType); if (Input::get('hide_modeOfProcurement') == "") { Session::put('m6', 'required'); } Session::put('imgsuccess', 'Files uploaded.'); return Redirect::back()->withInput(); } } else { // Set Main Error $message = "Failed to create purchase request."; Session::put('main_error', $message); // Get Other Error Messages $error_projectPurpose = $purchase->validationErrors->first('projectPurpose'); $error_projectType = $purchase->validationErrors->first('projectType'); $error_sourceOfFund = $purchase->validationErrors->first('sourceOfFund'); $error_amount = $purchase->validationErrors->first('amount'); $error_office = $purchase->validationErrors->first('office'); $error_requisitioner = $purchase->validationErrors->first('requisitioner'); $error_dateRequested = $purchase->validationErrors->first('dateRequested'); $error_dateReceived = $purchase->validationErrors->first('dateReceived'); // Inserting Error Message To a Session Session::put('error_projectPurpose', $error_projectPurpose); Session::put('error_sourceOfFund', $error_sourceOfFund); Session::put('error_amount', $error_amount); Session::put('error_office', $error_office); Session::put('error_requisitioner', $error_requisitioner); Session::put('error_dateRequested', $error_dateRequested); Session::put('error_dateReceived', $error_dateReceived); Session::put('error_projectType', $error_projectType); if (Input::get('hide_modeOfProcurement') == "") { Session::put('error_modeOfProcurement', 'required'); } if (Session::get('imgerror') && Input::hasfile('file')) { $failedpurchasecount = Purchase::where('id', $purchase->id)->count(); if ($failedpurchasecount != 0) { $failedpurchase = Purchase::find($purchase->id); $failedpurchase->delete(); } Session::forget('imgsuccess'); //Image Error Return $task_details = TaskDetails::where('doc_id', $document->id)->delete(); $document->delete(); $message = "Failed to create purchase request."; // Set Main Error $message = "Failed to save purchase request."; Session::put('main_error', $message); // Get Other Error Messages $error_projectPurpose = $purchase->validationErrors->first('projectPurpose'); $error_projectType = $purchase->validationErrors->first('projectType'); $error_sourceOfFund = $purchase->validationErrors->first('sourceOfFund'); $error_amount = $purchase->validationErrors->first('amount'); $error_office = $purchase->validationErrors->first('office'); $error_requisitioner = $purchase->validationErrors->first('requisitioner'); $error_dateRequested = $purchase->validationErrors->first('dateRequested'); $error_dateReceived = $purchase->validationErrors->first('dateReceived'); // Inserting Error Message To a Session Session::put('error_projectPurpose', $error_projectPurpose); Session::put('error_sourceOfFund', $error_sourceOfFund); Session::put('error_amount', $error_amount); Session::put('error_office', $error_office); Session::put('error_requisitioner', $error_requisitioner); Session::put('error_dateRequested', $error_dateRequested); Session::put('error_dateReceived', $error_dateReceived); Session::put('error_projectType', $error_projectType); } return Redirect::back()->withInput(); } $numLoop++; } }
<?php $wfName = Workflow::find('1'); ?> <br/> <?php $sectionName = Section::find('5'); ?> <!-- PURCHASE REQUEST SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('1'); ?> <div class="panel-title"> <?php $section_name = strtoupper($sectionName->sectionName); $position = 90; $str = substr($section_name, 0, $position) . "<br>" . substr($section_name, $position); echo $str; ?> </div> </div> <div class="panel-body"> <!-- Displays form for adding new tasks to the workflow --> <div id="office-create-form" class="well div-form">
<?php $wfName = Workflow::find('4'); ?> <br/> <!-- PURCHASE REQUEST SECTION --> <div class="panel panel-success"> <div class="panel-heading"> <?php $sectionName = Section::find('13'); ?> <div class="panel-title"> <?php $section_name = strtoupper($sectionName->sectionName); $position = 90; $str = substr($section_name, 0, $position) . "<br>" . substr($section_name, $position); echo $str; ?> </div> </div> <div class="panel-body"> <!-- Displays form for adding new tasks to the workflow --> <div id="office-create-form" class="well div-form"> {{ Form::open(['url'=>'addtask'], 'POST', array('role' => 'form')) }} <div class="col-md-8"> {{ Form::text('label', null, array('class' => 'form-control', 'placeholder' => 'Enter field label here','maxlength'=>'45')) }} <input type ="hidden" name="section_id" value="{{$sectionName->id}}">