芝麻web文件管理V1.00
编辑当前文件:/home/sditechnicalteam/socialsolargreens.pk/controller/ServicesController.php
con,$Services); return $data; } // [Route("/Create-New-Service-Type")] public function Save($Service_data = '') { if (!empty($Service_data)) { if (empty($Service_data['service_id'])) { $q = "INSERT INTO services (`Name`) VALUES ('".$Service_data['service_name']."')"; if (mysqli_query($this->con, $q)) { return 'Insert Successful.'; } else { return "Error Code [132]: " . mysqli_error($this->con); } } else { $q2 = "UPDATE services SET Name = '".$Service_data['service_name']."' WHERE Id = '".$Service_data['service_id']."'"; if (mysqli_query($this->con, $q2)) { // return json_encode($Customer); return 'Update Successful'; } else{ return "Error Code [421] : " . mysqli_error($this->con); } } } } public function Edit($AccountNo = ''){ if(!empty($AccountNo)){ $AccountNo = "select * from services where id = $AccountNo"; $d = mysqli_query($this->con, $AccountNo); // print_r($d); if ($d->num_rows > 0) { $data = mysqli_fetch_assoc($d); return $data; } else{ return "Error Code [521] : " . mysqli_error($this->con); } } } public function Delete($AccountNo = ''){ $service = "DELETE FROM services WHERE Id = '".$AccountNo."'"; if (mysqli_query($this->con, $service )) { return 'Service Deleted Success'; } else{ return "Error Code [245] : " . mysqli_error($this->con); } } } ?>