Ejemplo n.º 1
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['details'] = NULL;
         $this->info['cli'] = NULL;
         $this->info['soil'] = NULL;
         $this->info['crops'] = NULL;
         $this->info['landuse'] = NULL;
         $this->info['geo_area'] = NULL;
         $this->info['land_forest'] = NULL;
         $this->info['land_sown'] = NULL;
         $this->info['well_irrigated_area'] = NULL;
         $this->info['tank_irrigated_area'] = NULL;
         $this->info['canal_irrigated_area'] = NULL;
         $this->info['other_irrigated_area'] = NULL;
         $this->info['net_irrigated_area'] = NULL;
         $this->info['gross_irrigated_area'] = NULL;
         $this->info['district'] = NULL;
         $this->info['type'] = NULL;
         $this->formName = 'locationAddForm';
         $this->legend = 'Add Location';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'locationUpdateForm';
             $this->legend = 'Update Location';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Location";
 }
Ejemplo n.º 2
0
 function getDetails($table, $data = '*', $cond = NULL, $list = FALSE, $exact = FALSE)
 {
     if (Main::$con == FALSE) {
         Main::openConnection();
         $this->newCon = TRUE;
     }
     $data = Main::escape($data);
     $query = Main::generateQuery('SELECT', $data, $table, $cond);
     //echo $query;
     if ($query) {
         $result = mysql_query($query) or Main::throwException('Internal Error Occured', 0, 'Query Failed ' . $query . " " . mysql_error());
         if (mysql_num_rows($result) > 0) {
             $data = array();
             while ($row = mysql_fetch_assoc($result)) {
                 if (!$list) {
                     $data[] = $row;
                 } else {
                     foreach ($row as $key => $value) {
                         $data[] = $value;
                     }
                 }
             }
             return $data;
         } else {
             return array();
         }
     } else {
         echo "Query Not Found";
     }
 }
Ejemplo n.º 3
0
 function __construct($data, $table, $cond)
 {
     if (Main::$con == FALSE) {
         Main::openConnection();
         $this->newCon = TRUE;
     }
     $data = Main::escape($data);
     $query = Main::generateQuery('UPDATE', $data, $table, $cond);
     mysql_query($query) or Main::throwException('Internal Error Occured', 0, 'Query Failed' . mysql_error());
     //Main::displaySuccess('DataBase Updated Successfully');
 }
Ejemplo n.º 4
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['details'] = NULL;
         $this->formName = 'cropTypeAddForm';
         $this->legend = 'Add Crop Type';
         $this->section = 'Add';
         $this->hdrcnt = '$this->section Crop Types';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'cropTypeUpdateForm';
             $this->legend = 'Update Crop Type';
             $this->section = 'Update';
         }
     }
 }
Ejemplo n.º 5
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['news'] = NULL;
         $this->info['date'] = NULL;
         $this->info['time'] = NULL;
         $this->formName = 'newsAddForm';
         $this->legend = 'Add News';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'newsUpdateForm';
             $this->legend = 'Update News';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} News";
 }
Ejemplo n.º 6
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['control'] = NULL;
         $this->info['details'] = NULL;
         $this->formName = 'diseaseAddForm';
         $this->legend = 'Add Disease';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'diseaseUpdateForm';
             $this->legend = 'Update Disease';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Disease";
 }
Ejemplo n.º 7
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['details'] = NULL;
         $this->info['price'] = NULL;
         $this->formName = 'bioFertAddForm';
         $this->legend = 'Add Bio Fertilizer';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'biofertUpdateForm';
             $this->legend = 'Update Insurance';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Bio Fertilizer";
 }
Ejemplo n.º 8
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['year'] = NULL;
         $this->info['activity'] = NULL;
         $this->info['location'] = NULL;
         $this->formName = 'prevActivityAddForm';
         $this->legend = 'Add PrevActivity';
         $this->section = 'Add';
         $this->info['update'] = 'NULL';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'prevActivityUpdateForm';
             $this->legend = 'Update PrevActivity';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Previous Year Activity";
 }
Ejemplo n.º 9
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['level'] = NULL;
         $this->info['name'] = NULL;
         $this->info['details'] = NULL;
         $this->info['year'] = NULL;
         $this->formName = 'awardAddForm';
         $this->legend = 'Add Award';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'awardUpdateForm';
             $this->legend = 'Update Award';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Award";
 }
Ejemplo n.º 10
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['from'] = NULL;
         $this->info['sub'] = NULL;
         $this->info['msg'] = NULL;
         $this->info['date'] = NULL;
         $this->info['time'] = NULL;
         $this->formName = 'messageAddForm';
         $this->legend = 'Add Message';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'messageUpdateForm';
             $this->legend = 'Update Message';
             $this->section = 'Update';
         }
     }
     $this->data();
 }
Ejemplo n.º 11
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['title'] = NULL;
         $this->info['year'] = NULL;
         $this->info['author'] = NULL;
         $this->info['publisher'] = NULL;
         $this->info['price'] = NULL;
         $this->formName = 'publicationAddForm';
         $this->legend = 'Add Publication';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'publicationUpdateForm';
             $this->legend = 'Update Publication';
             $this->section = 'Update';
         }
     }
     $this->data();
 }
Ejemplo n.º 12
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['holders'] = NULL;
         $this->info['year'] = NULL;
         $this->info['no'] = NULL;
         $this->info['update'] = NULL;
         $this->formName = 'patentAddForm';
         $this->legend = 'Add Patent';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'patentUpdateForm';
             $this->legend = 'Update Patent';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Patents";
 }
Ejemplo n.º 13
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['type'] = NULL;
         $this->info['annual_price'] = NULL;
         $this->info['single_price'] = NULL;
         $this->info['lifetime_price'] = NULL;
         $this->formName = 'magazineAddForm';
         $this->legend = 'Add Magazine';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'magazineeUpdateForm';
             $this->legend = 'Update Magazine';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Magazine";
 }
Ejemplo n.º 14
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['crop'] = NULL;
         $this->info['no'] = NULL;
         $this->info['age'] = NULL;
         $this->info['premium'] = NULL;
         $this->info['compensation'] = NULL;
         $this->formName = 'insuranceAddForm';
         $this->legend = 'Add Insurance';
         $this->section = 'Add';
         $this->hdrtxt = 'Insurance';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load Data');
         } else {
             $this->info = $info;
             $this->formName = 'insuranceUpdateForm';
             $this->legend = 'Update Insurance';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Insurance";
 }
Ejemplo n.º 15
0
 function __construct($info = NULL)
 {
     if (!isset($info)) {
         $this->info['name'] = NULL;
         $this->info['type'] = NULL;
         $this->info['code'] = NULL;
         $this->info['number'] = NULL;
         $this->info['district'] = NULL;
         $this->info['location'] = NULL;
         $this->formName = 'contactAddForm';
         $this->legend = 'Add Contact Details';
         $this->section = 'Add';
     } else {
         if (empty($info)) {
             Main::throwException('Internal Error Occured', 0, 'Failed To Load The Data');
         } else {
             $this->info = $info;
             $this->formName = 'contactUpdateForm';
             $this->legend = 'Update Contact Details';
             $this->section = 'Update';
         }
     }
     $this->hdrcnt = "{$this->section} Contact";
 }