Beispiel #1
0
 public function show($condition)
 {
     $sql = "SELECT * FROM " . DB_PREFIX . "audit_record WHERE " . $condition;
     //echo $sql;die;
     $q = $this->db->query($sql);
     $data = $audit_record = array();
     $bill_id = $space = '';
     //$i = 0;
     while ($row = $this->db->fetch_array($q)) {
         if ($row['audit_level'] > 0) {
             $sql = "SELECT * FROM " . DB_PREFIX . "audit_record WHERE state=0 AND bill_id=" . $row['bill_id'] . " AND audit_level<" . $row['audit_level'];
             //echo $sql;die;
             $f = $this->db->query_first($sql);
             if (!$f) {
                 if ($row['bill_id']) {
                     $bill_id .= $space . $row['bill_id'];
                     $space = ',';
                 }
                 $data[] = $row;
             }
             //存在,说明上一级审核未通过
         } else {
             if ($row['bill_id']) {
                 $bill_id .= $space . $row['bill_id'];
                 $space = ',';
             }
             $data[] = $row;
         }
     }
     if ($bill_id) {
         include_once CUR_CONF_PATH . 'lib/bill.class.php';
         $bill = new bill();
         $bill_info = $tmp = array();
         $tmp = $bill->show(' AND id IN(' . $bill_id . ')');
         if ($tmp) {
             foreach ($tmp as $k => $v) {
                 $bill_info[$v['id']] = array('project_name' => $v['project_name'], 'cause' => $v['cause'], 'user_id' => $v['user_id'], 'user_name' => $v['user_name']);
             }
             foreach ($data as $k => $v) {
                 $data[$k]['bill'] = $bill_info[$v['bill_id']];
             }
         }
     }
     return $data;
 }
Beispiel #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function destroypatient()
 {
     $id = $_GET['id'];
     ////        $patient->bed = Input::get('bed');
     //        $patient = Patient::find($id);
     //        \Illuminate\Support\Facades\DB::update("update beds set status ='active' where id='$patient->bed'");
     //        \Illuminate\Support\Facades\DB::update("update rooms set status ='active' where id='$patient->room'");
     ////        \Illuminate\Support\Facades\DB::table('bills')->where($patient,'id')
     //        $patient->delete();
     $bill = bill::findOrFail($id);
     //        $bill = Bill::all();
     return View::make('discharge.discharge_slip', compact('bill'));
 }
Beispiel #3
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $bill = bill::findOrFail($id);
     return View::make('bills.edit', compact('bill'));
 }
Beispiel #4
0
     *
     * @param $tmp_name int the temporary location of the image file
     * @param $destination int upload destination
     *
     * @return bool
     */
    public function moveUploadedFile($tmp_name, $destination)
    {
        return imagejpeg($tmp_name, $destination);
    }
}
if (isset($_POST["submit"])) {
    $formdata = $_POST["does_what"];
    // dont forget to sanitize any post data
    //than you can call your class function and pass this data
    $bill = new bill();
    if (!$bill->upload($formdata)) {
        $upload_error = TRUE;
    }
}
if (isset($_GET['billpath'])) {
    if (!preg_match('/^[a-z0-9_]+\\.jpg$/', $_GET['billpath'])) {
        echo 'Unknown error';
        return false;
    }
    $imagepreview = preg_replace('/[^-a-zA-Z0-9_]/', '', $_GET['billpath']);
    $imagepreview = 'bills/' . $_GET['billpath'];
} else {
    $imagesDir = 'bills/';
    $images = glob($imagesDir . '*.{jpg}', GLOB_BRACE);
    $imagepreview = $images[array_rand($images)];
Beispiel #5
0
 public function action_mark_as_paid()
 {
     $details = $this->request->param('options');
     list($bill_id, $pay_date) = explode('/', $details);
     $bill = new bill($bill_id);
     $bill->pay($pay_date);
     $this->redirect();
 }