예제 #1
0
 public function __construct($path = './Public/Upload/', $randfix = 1)
 {
     $path = rtrim($path, '/') . '/';
     if (is_writable($path)) {
         if (!file_exists($path)) {
             mkdir($path, 0755, TRUE);
         }
     } else {
         Debug::addmsg('<font color="red">' . $path . '不可写!</font>');
     }
     self::$path = $path;
     self::$randfix = $randfix;
 }
예제 #2
0
 public function del_meter($id)
 {
     $result = Water::where('meter_id', $id)->delete();
     if ($result) {
         $data = DB::Select(' select * from s_water_meter ');
         $t = '<table  class="responsive">';
         $t .= '<tr>';
         $t .= '<th width="80">ลำดับ</th> <th>เลขมิเตอร์น้ำ</th> <th width="50">ลบ</th>';
         $t .= '</tr>';
         $i = 0;
         foreach ($data as $k) {
             $i++;
             $t .= '<tr>';
             $t .= '<td>' . $i . '</td>';
             $t .= '<td>' . $k->name_meter . '</td>';
             $t .= '<td><a href="#" onclick="del_meter( ' . $k->meter_id . ' )"><i class="fi-x small"></i></a></td>';
             $t .= '</tr>';
         }
         $t .= '</table>';
         return $t;
     } else {
         return 'no';
     }
 }
예제 #3
0
 function startElement($parser, $tagName, $attrs)
 {
     switch ($tagName) {
         case "WATER":
             $water = new Water();
             $water->parse($parser, $this);
             $this->waters[] = $water;
             break;
         default:
             break;
     }
 }