Beispiel #1
0
 public function testCheckEnquiry()
 {
     $enq = Enquiry::Create('Alex Mbaka', '0727596626', 'Topocadastral Survey, Engineering Survey', 'In my plot');
     Enquiry::Check($enq->stamp);
     $enquiry = Enquiry::GetEnquiry($enq->stamp);
     $this->assertInstanceOf('Enquiry', $enquiry);
     $this->assertTrue($enquiry->status == 1);
 }
 public function testCheckEnquiry()
 {
     $stamp = 20150818102512;
     $date = '18/08/2015';
     $enq = new Enquiry('Robert Mbabu', '0720563214', 'Fixed Boundary Survey', 'In my plot', $date, $stamp);
     $enq->persist();
     Enquiry::Check($stamp);
     $enquiry = Enquiry::GetEnquiry($stamp);
     $this->assertInstanceOf('Enquiry', $enquiry);
     $this->assertTrue($enquiry->status == 0);
 }
Beispiel #3
0
 public function checkEnquiry($stamp)
 {
     Enquiry::Check($stamp);
     $enquiry = Enquiry::GetEnquiry($stamp);
     if ($enquiry->status == 1) {
         echo 1;
     } else {
         echo 0;
     }
 }
 private function processLatestEnquiries()
 {
     try {
         $sql = 'SELECT stamp FROM enquiries WHERE status = 0 ORDER BY stamp DESC LIMIT 0,5';
         $res = DatabaseHandler::GetAll($sql);
         $sql2 = 'SELECT count(*) FROM enquiries WHERE status = 0';
         $res2 = DatabaseHandler::GetOne($sql2);
         $enquiries = [];
         foreach ($res as $enquiry) {
             $enquiries[] = Enquiry::GetEnquiry($enquiry['stamp']);
         }
         $obj = new stdClass();
         $obj->enquiries = $enquiries;
         $obj->total = $res2;
         $this->latestEnquiries = $obj;
     } catch (Exception $e) {
     }
 }