public function addjobs()
 {
     if (is_numeric($this->id)) {
         $db = new Db();
         if (Session::read("userid")) {
             $user_id = Session::read("userid");
             $id = $db->quote($this->id);
             $heading = $db->quote($this->heading);
             $post = $db->quote($this->post);
             $education = $db->quote($this->education);
             $exp_min = $db->quote($this->exper_min);
             $exp_max = $db->quote($this->exper_max);
             $salary = $db->quote($this->salary);
             $description = $db->quote($this->description);
             $company_name = $db->quote($this->company_name);
             $website = $db->quote($this->website);
             $email = $db->quote($this->email);
             $phone = $db->quote($this->phone);
             $city = $db->quote($this->city);
             $address = $db->quote($this->address);
             $query = "INSERT INTO " . $this->tableName() . " (id,user_id, heading, post, education, exp_min, exp_max,\n                salary, description, company_name, company_url, phone, city, address, active)\n                VALUES({$id} ,{$user_id},{$heading},{$post},{$education},{$exp_min},{$exp_max},{$salary},{$description},{$company_name},{$website},{$email},\n                   {$phone},{$city},{$address},1)";
             if ($db->query($query)) {
                 if ($db->affectedRows()) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
 public function addcompany()
 {
     $errors = Error::get("error");
     if (!count($errors) || $errors == "") {
         $db = new Db();
         if (Session::read("userid")) {
             $user_id = Session::read("userid");
             //print_r($user_id);                exit();
             // $user_id=$db->quote($this->user_id);
             $name = $db->quote($this->name);
             $email = $db->quote($this->email);
             $website = $db->quote($this->website);
             $phone = $db->quote($this->phone);
             $city = $db->quote($this->city);
             $location = $db->quote($this->location);
             $specialization = $db->quote($this->specialization);
             $description = $db->quote($this->description);
             $query = "INSERT INTO " . $this->tableName() . " (user_id,name,city,location,website,email,phone,specialization,description,active) \n                VALUES({$user_id},{$name},{$city},{$location},{$website},{$email},{$phone},{$specialization},{$description},1)";
             if ($db->query($query)) {
                 //print_r($query);                exit();
                 if ($db->affectedRows()) {
                     return true;
                 }
             }
         }
     }
     return false;
 }
 public function save()
 {
     if (is_numeric($this->id) && is_string($this->name)) {
         $db = new Db();
         $id = $db->quote($this->id);
         $user_id = $db->quote($this->user_id);
         $doc_type_id = $db->quote($this->doc_type_id);
         $heading = $db->quote($this->heading);
         $description = $db->quote($this->desc);
         $category_id = $db->quote($this->category_id);
         $cost = $db->quote($this->cost);
         $case = $db->quote($this->case_no);
         $judge = $db->quote($this->judges);
         $act = $db->quote($this->act);
         $file = $db->quote($this->file);
         $active = $db->quote($this->active);
         $query = "INSERT INTO " . $this->tableName() . " (user_id,type_id,heading,desc,category_id,cost,case_no,judges,act,file,active) \n                VALUES({$doc_type_id},{$heading},{$description},{$category_id},{$cost},{$case},{$judge},{$act},{$file}, {$active}) \n                ON DUPLICATE KEY UPDATE    \n               user_id={$user_id},type_id={$doc_type_id},heading={$heading},desc={$description},category_id={$category_id},cost={$cost},\n                   case_no={$cost},judges={$judge},act={$act},file={$file},active={$active}";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
 function addquestion()
 {
     $db = new Db();
     $question = $db->quote($this->question);
     $heading = $db->quote($this->heading);
     $topic = $db->quote($this->topic_id);
     $city = $db->quote($this->city);
     $query = "INSERT INTO " . $this->tableName() . " (question, heading,topic_id, city, active) \n                VALUES({$question},{$heading},{$topic},{$city},1)";
     if ($db->query($query)) {
         //print_r($query);                exit();
         if ($db->affectedRows()) {
             return true;
         }
     }
 }
 public function save()
 {
     if (is_numeric($this->id)) {
         $db = new Db();
         $id = $db->quote($this->id);
         $active = $db->quote($this->active);
         $query = "INSERT INTO " . $this->tableName() . " (id, active)VALUES({$id} , {$active}) \n                ON DUPLICATE KEY UPDATE    \n                active={$active}";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
Пример #6
0
 public function save()
 {
     if (is_numeric($this->country_id) && is_string($this->country_name)) {
         $db = new Db();
         $id = $db->quote($this->country_id);
         $name = $db->quote($this->country_name);
         $active = $db->quote($this->country_status);
         $query = "INSERT INTO " . $this->tableName() . " (id, name, active) VALUES({$id},{$name} , {$active}) \n                ON DUPLICATE KEY UPDATE    \n                name= {$name}, active={$active}";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
 public function save()
 {
     //        if(is_numeric($this->id) && is_string($this->name)){
     $db = new Db();
     //            $id = $db->quote($this->id);
     $name = $db->quote($this->name);
     $url = $db->quote($this->url);
     $active = $db->quote($this->pagecategory_status);
     $query = "INSERT INTO " . $this->table() . " (name,url, active) VALUES({$name},{$url} , {$active}) \n                ON DUPLICATE KEY UPDATE    \n                name= {$name}, active={$active}";
     if ($db->query($query)) {
         if ($db->affectedRows()) {
             return true;
         }
     }
     //        }
     return false;
 }
 public function save()
 {
     if (is_numeric($this->id) && is_string($this->legal_service)) {
         $db = new Db();
         $id = $db->quote($this->id);
         $legal_service = $db->quote($this->legal_service);
         $description = $db->quote($this->description);
         $cost = $db->quote($this->cost);
         $time = $db->quote($this->time);
         $active = $db->quote($this->active);
         $query = "INSERT INTO " . $this->tableName() . " (id,legal_service,description,cost,time, active) VALUES({$id},{$legal_service},{$description},{$cost},{$time} , {$active}) \n                ON DUPLICATE KEY UPDATE    \n               legal_service= {$legal_service},description={$description},cost={$cost},time={$time} active={$active}";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
 public function save()
 {
     if (is_numeric($this->id) && is_string($this->name)) {
         $db = new Db();
         $id = $db->quote($this->id);
         $user_id = $db->quote($this->user_id);
         $city_name = $db->quote($this->city_name);
         $locality = $db->quote($this->locality);
         $builder = $db->quote($this->builder_name);
         $project = $db->quote($this->project_name);
         $clear = $db->quote($this->clear_title);
         $legal_risk = $db->quote($this->legal_risk);
         $legal_description = $db->quote($this->legal_description);
         $active = $db->quote($this->active);
         $query = "INSERT INTO " . $this->tableName() . " (user_id,city_name,locality,builder_name,project_name,clear_title,legal_risk,legal_description,active) \n                VALUES({$user_id},{$city_name},{$locality},{$builder},{$project},{$clear},{$legal_risk},{$legal_description}, {$active})";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
 public function save()
 {
     if (is_numeric($this->menu_id) && is_string($this->menu_name)) {
         $db = new Db();
         $id = $db->quote($this->menu_id);
         $name = $db->quote($this->menu_name);
         $category_id = $db->quote($this->category_id);
         $parent_id = $db->quote($this->parent_id);
         $url = $db->quote($this->url);
         $image = $db->quote($this->image);
         $access_type = $db->quote($this->access_type);
         $menu_order = $db->quote($this->menu_order);
         $active = $db->quote($this->menu_status);
         $query = "INSERT INTO " . $this->tableName() . " (id, name, category_id, parent_id, image, url, active, access_type, menu_order) \n                VALUES({$id}, {$name}, {$category_id}, {$parent_id},{$image}, {$url}, {$active}, {$access_type}, {$menu_order})\n                ON DUPLICATE KEY UPDATE    \n                name= {$name}, category_id={$category_id}, parent_id={$parent_id},image={$image}, url={$url}, access_type={$access_type}, menu_order={$menu_order}, active={$active}";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
Пример #11
0
 public function save()
 {
     if (is_numeric($this->page_id) && is_string($this->page_name)) {
         $db = new Db();
         $id = $db->quote($this->page_id);
         $category_id = $db->quote($this->category_id);
         $name = $db->quote($this->page_name);
         $url = $db->quote($this->url);
         $top_description = $db->quote($this->top_description);
         $bottem_description = $db->quote($this->bottom_description);
         $keyword = $db->quote($this->keyword);
         $title = $db->quote($this->title);
         $description = $db->quote($this->description);
         $access_type = $db->quote($this->access_type);
         $active = $db->quote($this->page_status);
         $author = $db->quote(1);
         $modified = $db->quote(1);
         $query = "INSERT INTO " . $this->tableName() . " (page_id, category_id, name, url, top_description, bottem_description, \n                Keyword, title, description, author, modified_by, access_type,  active) \n                VALUES({$id}, {$category_id},  {$name}, {$url}, {$top_description}, {$bottem_description}, {$keyword}, {$title}, {$description},\n                    {$author}, {$modified}, {$access_type}, {$active})\n                ON DUPLICATE KEY UPDATE    \n                name= {$name}, category_id={$category_id}, url={$url},top_description={$top_description}, bottem_description={$bottem_description}, \n                Keyword={$keyword}, title={$title}, description={$description}, author={$author}, modified_by={$modified}, \n                   active={$active}, access_type={$access_type}";
         if ($db->query($query)) {
             if ($db->affectedRows()) {
                 return true;
             }
         }
     }
     return false;
 }
 function editProfile($user_id)
 {
     $errors = Error::get("error");
     if (!count($errors) || $errors == "") {
         $db = new Db();
         if (Session::read("userid")) {
             $user_id = Session::read("userid");
             //$user_id= $db->quote($this->user_id);
             $name = $db->quote($this->name);
             $website = $db->quote($this->website);
             //$mobile = $db->quote($this->mobile);
             $add = $db->quote($this->add);
             $city = $db->quote($this->city);
             $location = $db->quote($this->location);
             $education = $db->quote($this->education);
             $experience = $db->quote($this->experince);
             $specialization = $db->quote($this->specialization);
             $pra_court = $db->quote($this->practicing_court);
             $query = "update user  set Name={$name}, Website={$website}, Address={$add},\n                City={$city}, Location={$location}, Education={$education}, Experiance={$experience}, Specialization={$specialization},\n                    PracticingCourt={$pra_court}  where UserId={$user_id}";
             if ($db->query($query)) {
                 if ($db->affectedRows()) {
                     return true;
                 }
             }
         }
     }
 }