예제 #1
0
</script>
      <div id="msglis<?php 
echo $bookingId;
?>
"> 
                             
          <div id="mailbox-inbox" class="ajax-paged"><!-- class ajax-paged required to make pagination work -->
           
            <div class="grid-header-row"> <span class="subject dkm">Subject</span> 
            <!--<span class="username">From</span> --> 
            <!--<span class="lowest_bid">Quote</span> --> 
            <span class="date"><a href="/ajax-dashboard-customer-messages/sort-field-created_at/sort-direction-asc" class="">Received</a></span> 
            <!--<span class="delete-message bluebtn dlt">Delete</span>--> </div>
            <?php 
$loggedId = Yii::app()->session['loggedId'];
$name = CustomerUser::model()->findByPk(array('id' => $loggedId));
$custname = $name->cname;
$lastId = end($inbox);
$last = $lastId['id'];
echo "<input type='hidden' id='msgnotify' value='" . $last . "'>";
foreach ($inbox as $msg1) {
    ?>
            <div class="message close has-more read- first-row unread" id="<?php 
    echo $msg1->id;
    ?>
" data-id="17602932">
              <!-- <div class="status read"></div>-->
              <div class="subject cust"><?php 
    echo $msg1->conversation['subject'];
    ?>
</div>
예제 #2
0
 public function actionForgotPassword()
 {
     $model = new ForgotPassword();
     $getEmail = $_POST['ForgotPassword']['email'];
     $getModel = ServiceUser::model()->findByAttributes(array('email' => $getEmail));
     $gtModel = CustomerUser::model()->findByAttributes(array('email' => $getEmail));
     if (isset($_POST['ForgotPassword'])) {
         $model->attributes = $_POST['ForgotPassword'];
         if ($model->validate()) {
             if (!empty($getModel)) {
                 $p = rand();
                 $pwd = md5($p);
                 $subject = 'Welcome to Wow Cleans';
                 $body = $this->renderPartial('registrationEmail', array('model' => $model, 'password' => $p), true);
                 $getModel->password = $pwd;
                 if ($getModel->save()) {
                     $msg = Yii::app()->user->setFlash('serviceforgot', "Please check you email !");
                     Yii::app()->mailer->send($model->email, $subject, $body);
                     $this->redirect(array('registration/registration/index'));
                 }
             }
             if (!empty($gtModel)) {
                 $p = rand();
                 $pwd = md5($p);
                 $subject = 'Welcome to Wow Cleans';
                 $body = $this->renderPartial('registrationEmail', array('model' => $model, 'password' => $p), true);
                 $gtModel->password = $pwd;
                 if ($gtModel->save()) {
                     Yii::app()->mailer->send($model->email, $subject, $body);
                     Yii::app()->user->setFlash('forgotc', "Please check you email");
                     $this->redirect(array('registration/registration/index'));
                 }
             }
         } else {
             $errors = $model->getErrors();
         }
     }
     $links = CmsPages::model()->findAll();
     Yii::app()->params['MyArray'] = $links;
     $this->render('forgotpassword', array('model' => $model));
 }
예제 #3
0
 public function actionTicketProviderMsgList()
 {
     $loggedId = $_REQUEST['loggedId'];
     $inbox = MsgDetails::model()->findAll(array('condition' => 'logged_id =:logged_id', 'group' => 'conversation_id', 'params' => array(':logged_id' => $loggedId)));
     foreach ($inbox as $conId) {
         $inboxDtal[] = MsgDetails::model()->findAll(array('condition' => 'conversation_id=:conversation_id AND inbox_dlt_status=:status', 'params' => array(':conversation_id' => $conId->conversation_id, ':status' => 0)));
         $companyN = CustomerUser::model()->findAll(array('condition' => 'id=:id', 'params' => array(':id' => $conId->user_id)));
     }
     if (!empty($inbox)) {
         $this->renderPartial('renderticketproviderlist', array('inbox' => $inbox, 'inboxDtal' => $inboxDtal, 'companyN' => $companyN, 'bookingId' => $bookingId));
     } else {
         echo " ";
         die;
     }
 }
예제 #4
0
 public function actionExport()
 {
     $re = CustomerUser::model()->findAll();
     //echo "<pre>";print_r($re);die;
     foreach ($re as $res) {
         $name = $res['cname'] . " " . $res['clname'];
         $email = $res['email'];
         $country = $res['country'];
         $phone = $res['phone'];
         $zip = $res['zipcode'];
         $customer[] = array('Name' => $name, 'Email Address' => $email, 'Country' => $country, 'Phone' => $phone, 'Zip' => $zip);
     }
     //die;	//echo "<pre>";print_r($val);die;
     $filename = "customer.csv";
     $csv = new ECSVExport($customer);
     $content = $csv->toCSV();
     Yii::app()->getRequest()->sendFile($filename, $content, "text/csv", false);
     exit;
 }
예제 #5
0
 public function actionDashboard()
 {
     //echo "<pre>";print_r($_SESSION);die;
     $rec = ServiceUser::model()->findAll();
     /*foreach($rec as $re)
             {
             	$name[]=$re['company_name'];
     
             } */
     //echo "<pre>";print_r($name);die;
     //echo "<pre>";print_r(count($rec));die;
     $customer = CustomerUser::model()->findAll();
     $this->render('dashboard', array('name' => $rec, 'customer' => $customer));
 }
예제 #6
0
 public function actionCreateMessage()
 {
     $msg = new MsgDetails();
     $model = new ConversationMsg();
     if (isset($_POST['ConversationMsg']) && isset($_POST['MsgDetails'])) {
         $model->attributes = $_POST['ConversationMsg'];
         $msg->attributes = $_POST['MsgDetails'];
         if ($model->validate() || $msg->validate()) {
             $btn = $_REQUEST['btn'];
             if ($btn == 'company') {
                 //echo "<pre>";print_r($_REQUEST); die;
                 $email = $_REQUEST['ConversationMsg']['reciver_id'];
                 //echo $email;
                 $email = ltrim($email);
                 $email = rtrim($email);
                 $rec = ServiceUser::model()->findByAttributes(array('email' => $email));
                 //echo "fsfsf"."<pre>";print_r($rec);die;
                 $companyRecvierId = $rec->id;
                 //echo $companyRecvierId;die;
                 $sender_id = Yii::app()->session['username'];
                 $date = date('Y-m-d');
                 $model->date = $date;
                 $model->sender_id = $sender_id;
                 $model->sender_type = 'admin';
                 $model->reciver_id = $companyRecvierId;
                 $model->reciver_type = 'company';
                 $model->save(false);
                 $conversationId = Yii::app()->db->getLastInsertID();
                 $convMsg = ConversationMsg::model()->findByPk(array('id' => $conversationId));
                 //echo "<pre>";print_r($rec);die;
                 $text = $_REQUEST['MsgDetails']['msg'];
                 $msg->conversation_id = $conversationId;
                 $msg->user_type = 'admin';
                 $msg->msg = $text;
                 $msg->tomsg = $convMsg['reciver_id'];
                 $date = date('Y-m-d');
                 $msg->date = $date;
                 if ($msg->save(false)) {
                     $this->redirect(array('messagelisting'));
                 }
             } else {
                 $email = $_REQUEST['ConversationMsg']['reciver_id'];
                 //echo $email;die;
                 $email = ltrim($email);
                 $email = rtrim($email);
                 $rec = CustomerUser::model()->findByAttributes(array('email' => $email));
                 //echo "fsfsf"."<pre>";print_r($rec);die;
                 $companyRecvierId = $rec->id;
                 //echo $companyRecvierId;die;
                 $sender_id = Yii::app()->session['username'];
                 // echo $sender_id;die;
                 $date = date('Y-m-d');
                 $model->date = $date;
                 $model->sender_id = $sender_id;
                 $model->sender_type = 'admin';
                 $model->reciver_id = $companyRecvierId;
                 $model->reciver_type = 'company';
                 $model->save(false);
                 $conversationId = Yii::app()->db->getLastInsertID();
                 $convMsg = ConversationMsg::model()->findByPk(array('id' => $conversationId));
                 $text = $_REQUEST['MsgDetails']['msg'];
                 $msg->conversation_id = $conversationId;
                 $msg->user_type = 'admin';
                 $msg->msg = $text;
                 $msg->tomsg = $convMsg['reciver_id'];
                 $date = date('Y-m-d');
                 $msg->date = $date;
                 if ($msg->save(false)) {
                     $this->redirect(array('messagelisting'));
                 }
             }
         } else {
             $errors = $model->getErrors();
             //var_dump($errors);
             $err = $msg->getErrors();
             //var_dump($err);
         }
     }
     $this->render('createmessage', array('model' => $model, 'msg' => $msg));
 }
예제 #7
0
     echo $proname;
     echo "</div>";
     echo "<div class='leftMsg appendmsg" . $d['id'] . "'>";
     echo "<div class='time'>";
     echo date('jS \\of F Y  H:i:s', strtotime($d['date']));
     echo "</div>";
     echo "<div class='msg'>";
     echo $d['msg'];
     echo "</div>";
     echo "<div class='time'>";
     //echo $d['date'];
     echo "</div>";
     echo "</div>" . "</br>";
     echo "<div class='clear'></div>";
 } else {
     $name = CustomerUser::model()->findByPk(array('id' => $d['tomsg']));
     $name2 = ServiceUser::model()->findByPk(array('id' => $d['tomsg']));
     echo "<input type='hidden' id='" . $d['conversation_id'] . "' class='append'>";
     if (!empty($name)) {
         echo "<div class='rightname'>";
         echo $name['cname'];
         echo "</div>";
     } else {
         echo "<div class='rightname'>";
         echo $name2['company_name'];
         echo "</div>";
     }
     echo "<div class='rightMsg appendmsg" . $d['id'] . "'>";
     echo "<div class='time'>";
     echo date('jS \\of F Y  H:i:s', strtotime($d['date']));
     echo "</div>";