Exemple #1
0
 public function save_uploaded_contacts($data, $dest_path)
 {
     $ObjCUT = new contactsUploadedTempModel();
     $rowdata = array();
     if (($handle = fopen($dest_path . $data['filename'], "r")) !== FALSE) {
         while (($col = fgetcsv($handle, 1000, ",")) !== FALSE) {
             if ($col) {
                 $x = 1;
                 $rowdata['contact_id'] = $data['contact_id'];
                 foreach ($col as $value) {
                     $rowdata['column' . $x] = $value;
                     $x++;
                 }
                 $ObjCUT->insert_data($rowdata);
             }
         }
         fclose($handle);
     }
 }
 public function uploaded_contacts_delete()
 {
     $ObjCUT = new contactsUploadedTempModel();
     $cut_id_rows = Input::get('cut_id_rows');
     if ($cut_id_rows) {
         foreach ($cut_id_rows as $cut_id) {
             $where_params = array('`cut_id`=' => $cut_id);
             $ObjCUT->delete_data($where_params);
         }
     }
     return Redirect::to('upload_contacts');
 }